1

I'm trying to send a file to a wiki (it's in VSTS using git) through a REST api call in PowerShell.

What I have currently is:

Invoke-RestMethod -Method Put -Uri $uri -ContentType 'application/json' -headers $header

The error I get is:

Invoke-RestMethod : {"$id":"1","innerException":null,"message":"The page '/Wiki Page' specified in the add operation already exists in the wiki. Please specify a new page path."

I can't use post because the method is not accepted by the resource.

iask
  • 11
  • 2
  • [What operation are you specifying](https://learn.microsoft.com/en-us/rest/api/vsts/wiki/wikis?view=vsts-rest-4.1)? the page '/' doesnt look right as that seems like root. What page are you trying to update. I dont use VSTS but this is what I found after looking at the API real quick. – Matt Sep 13 '18 at 18:57
  • I meant to enter the name of the wiki page but somehow got deleted when I posted it – iask Sep 13 '18 at 19:11
  • 1
    @iask Have you seen this? https://developercommunity.visualstudio.com/content/problem/289074/update-wiki-page-rest-api-can-not-working.html – AussieJoe Sep 13 '18 at 20:44
  • Yes! That that helped got me in the right direction. Thanks!! – iask Sep 18 '18 at 16:36

0 Answers0