Skip to content

Commit

Permalink
Fixed issue with diacritic characters
Browse files Browse the repository at this point in the history
  • Loading branch information
ykuijs committed Mar 26, 2024
1 parent 917b751 commit 69e1936
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
M365DSC.CompositeResources being installed caused errors
- Fixed issue in Set-ADOEnvironment where the checks weren't updating due to missing
check id parameter
- Fixed issue with diacritic characters in Set-ADOEnvironment

## [0.2.5] - 2024-03-19

Expand Down
7 changes: 4 additions & 3 deletions source/Private/Invoke-APRestApi.ps1
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
function Invoke-APRestApi
{
<#
<#
.SYNOPSIS
Executes an API call to Azure DevOps.
Expand Down Expand Up @@ -55,8 +55,9 @@ function Invoke-APRestApi
try
{
$params = @{
Uri = $Uri
Method = $Method
Uri = $Uri
Method = $Method
ContentType = 'application/json;charset=utf-8'
}

if ($PSBoundParameters.ContainsKey('Headers'))
Expand Down
3 changes: 0 additions & 3 deletions source/Public/Set-ADOEnvironment.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,6 @@ function Set-ADOEnvironment
Write-Log -Object ' Parameter PAT is NOT specified, using environment variable SYSTEM_ACCESSTOKEN to authenticate'
$headers.Add('Authorization', ('Bearer {0}' -f $env:SYSTEM_ACCESSTOKEN))
}
$headers.Add('Content-Type', 'application/json')

# https://learn.microsoft.com/en-us/rest/api/azure/devops/distributedtask/environments/list?view=azure-devops-rest-7.1
Write-Log -Object 'Retrieving all environments'
Expand Down Expand Up @@ -368,10 +367,8 @@ function Set-ADOEnvironment
{
Write-Log -Object ' Updating check configuration'
$requestBody = ConvertTo-Json -InputObject $obj -Depth 10
Write-Log -Object " DEBUG: $requestBody"

$configUrl = '{0}/_apis/pipelines/checks/configurations/{2}?{1}' -f $devOpsProjectUrl, $apiVersionString, $checkId
Write-Log -Object " DEBUG: $configUrl"
if ($PSCmdlet.ShouldProcess('Configurations', 'Configure approvals'))
{
$null = Invoke-APRestApi -Uri $configUrl -Method 'PATCH' -Headers $headers -Body $requestBody
Expand Down

0 comments on commit 69e1936

Please sign in to comment.