DEV Community

Discussion on: Getting started with Azure DevOps API with PowerShell

Collapse
 
amolkhanorkar profile image
Amol Khanorkar

Hi Olivier,
I am getting error after executing below Invoke-restMethod,
Invoke-RestMethod -Uri $uriProject -Method Post -Headers $AzureDevOpsAuthenicationHeader -Body $projectConfiguration -ContentType "application/json"

Below is the error mesaage:
Invoke-RestMethod : Invalid URI: The hostname could not be parsed.
At line:1 char:1

  • Invoke-RestMethod -Uri $uriProject -Method Post -Headers $AzureDevOps ...
  • ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    • CategoryInfo : NotSpecified: (:) [Invoke-RestMethod], UriFormatException
    • FullyQualifiedErrorId : System.UriFormatException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand

Please help me resolve this error so I can try to create a Project and go-ahead.