Forum Discussion

Suleyman Ali's avatar
Suleyman Ali
Iron Contributor
May 03, 2023

remove-mgplannertask official documentation wrong?

we have a very small project to remove old planner tasks.  what we are having issue with when playing around with powershell graph sdk is the remove-mgplannertask command.  firstly, the example in the official documentation seems to be wrong.

 

Remove-MgPlannerTask -PlannerTaskId $plannerTaskId-If-Match W/"JzEtVGFzayAgQEBAQEBAQEBAQEBAQEBAWCc="

 

if we do it like this it comes up with a 'there is no positional parameter'. even the code snippet section of graph explorer has the same example. 

 

if we use the actual parameter as defined in the help e.g. 

 

Remove-MgPlannerTask -PlannerTaskId $plannerTaskId -IfMatch W/"JzEtVGFzayAgQEBAQEBAQEBAQEBAQEBAWCc="

 

this would come up as a invalid value.  what kind of works is:

 

Remove-MgPlannerTask -PlannerTaskId $plannerTaskId -IfMatch 'W/"JzEtVGFzayAgQEBAQEBAQEBAQEBAQEBAWCc="'

 

however, with our actual task ID and related etag, it comes up with a etag is tool old.  

 

but when using graph explorer... using the sameetag value, it works fine.  any help would be good.  in the meantime, we wont use the powershell SDK and look at using the invoke-restmethod / invoke-webrequest to send a delete command.

 

 

 

No RepliesBe the first to reply

Resources