github
2 Topicspowershell to run git commit using PAT in Azure github pipelines
I created a Personal Access Token for my repository and named it as 'PAT', created a variable called 'PATSecret' in my pipeline for the secret of PAT. Passing PATSecret as an input variable for $Cred. But when trying to use this secret to run commit command, authentication is failing. param( [string]$Cred ) git --version git add . Write-Host "setup author info" git config user.email you@you.com git config user.name "your name" Write-Host "git commit with message" git commit -m "Test Commit from Azure DevOps" git push -u https://PAT:$($cred)@dev.azure.com/project/_git/myrepo HEAD Error message: fatal: Authentication failed for 'https://dev.azure.com/project/_git/myrepo/' ##[error]PowerShell exited with code '1'.Solved7.5KViews1like4Comments