diff --git a/CHANGELOG.md b/CHANGELOG.md index 6179d62..73cb7cf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/source/Private/Invoke-APRestApi.ps1 b/source/Private/Invoke-APRestApi.ps1 index dca2661..529bd66 100644 --- a/source/Private/Invoke-APRestApi.ps1 +++ b/source/Private/Invoke-APRestApi.ps1 @@ -1,6 +1,6 @@ function Invoke-APRestApi { -<# + <# .SYNOPSIS Executes an API call to Azure DevOps. @@ -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')) diff --git a/source/Public/Set-ADOEnvironment.ps1 b/source/Public/Set-ADOEnvironment.ps1 index 497d383..ca88efa 100644 --- a/source/Public/Set-ADOEnvironment.ps1 +++ b/source/Public/Set-ADOEnvironment.ps1 @@ -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' @@ -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