I\'m using the Azure Dev OPS to trigger the build and deploy. I have angular code in GIT branch from which the build will be triggered and based on build# I need to update a fil
Based on the above suggestions. I have added the below mentioned code
$requestBody = @{
changes=
@(@{
item= @{
path= "$/SMT_Project/" + $branch + "/SMT/BPOSE_WebApp/Deal/LandingPage.aspx"
contentMetadata= @{
encoding= -1
}
}
changeType= "add"
newContent= @{
content= $EncodedText
contentType= "base64Encoded"
}
})
comment= "Updated LandingPage.aspx with script for deployment"
} | ConvertTo-Json -Depth 4
$headers = @{
Authorization = "Bearer $env:SYSTEM_ACCESSTOKEN"
}
$headers.Add("Accept", 'application/json')
$requestBodyJson = ($requestBody | ConvertFrom-Json)
Write-Host 'headers - ' $headers
Write-Host 'requestBody - ' $requestBody
Write-Host 'requestBodyJson - ' $requestBodyJson
$postRes = Invoke-WebRequest -Uri https://dev.azure.com/sm10/_apis/tfvc/changesets?api-version=5.1 -ContentType "application/json" -Headers $headers -Method POST -Body $requestBody -Verbose
But I have not received and response from the web request also I have not received any errors. Please do let me know anything is missing.