The PAT used for the connection has "Code (read, write & manage)" permissions.
Executing the POST to the URL using same PAT in postman works.
Actual behavior?
WARNING: An error occurred: The remote server returned an error: (401) Unauthorized.
Invoke-RestMethod : The remote server returned an error: (401) Unauthorized.
At C:\Users\ptamarit\Documents\WindowsPowerShell\Modules\VSTeam\7.9.0\vsteam.functions.ps1:266 char:18
Steps to reproduce
Expected behavior
It should create a new branch "release/release01" as a copy of the "main" branch under the repository "[Repository_Name]". Should be the same as executing the API: https://dev.azure.com/[ORG]/[PROJECT_NAME]/_apis/git/repositories/[REPOSITORY_NAME]/refs?api-version=5.0
The PAT used for the connection has "Code (read, write & manage)" permissions. Executing the POST to the URL using same PAT in postman works.
Actual behavior?
WARNING: An error occurred: The remote server returned an error: (401) Unauthorized. Invoke-RestMethod : The remote server returned an error: (401) Unauthorized. At C:\Users\ptamarit\Documents\WindowsPowerShell\Modules\VSTeam\7.9.0\vsteam.functions.ps1:266 char:18
On Which OS have you tried it?
Windows
What was your server version?
No response
Other server version
No response
Log output of used API
Log output of $PSVersionTable