From 0cce9f5a11ac850850f1439b70b11a55093f00b5 Mon Sep 17 00:00:00 2001 From: Stijn Moreels <9039753+stijnmoreels@users.noreply.github.com> Date: Tue, 11 Jun 2024 07:43:13 +0200 Subject: [PATCH 1/2] fix: az devops takes heading space as part of value --- src/Arcus.Scripting.DevOps/Arcus.Scripting.DevOps.psm1 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Arcus.Scripting.DevOps/Arcus.Scripting.DevOps.psm1 b/src/Arcus.Scripting.DevOps/Arcus.Scripting.DevOps.psm1 index 5a069e26..87586675 100644 --- a/src/Arcus.Scripting.DevOps/Arcus.Scripting.DevOps.psm1 +++ b/src/Arcus.Scripting.DevOps/Arcus.Scripting.DevOps.psm1 @@ -19,9 +19,9 @@ function Set-AzDevOpsVariable { ) if ($AsSecret) { - Write-Host "##vso[task.setvariable variable=$Name;issecret=true] $Value" + Write-Host "##vso[task.setvariable variable=$Name;issecret=true]$Value" } else { - Write-Host "##vso[task.setvariable variable=$Name] $Value" + Write-Host "##vso[task.setvariable variable=$Name]$Value" } } @@ -105,4 +105,4 @@ function Save-AzDevOpsBuild { . $PSScriptRoot\Scripts\Save-AzDevOpsBuild.ps1 -ProjectId $ProjectId -BuildId $BuildId -DaysToKeep $DaysToKeep } -Export-ModuleMember -Function Save-AzDevOpsBuild \ No newline at end of file +Export-ModuleMember -Function Save-AzDevOpsBuild From 0041cdb745ee71e58a892ad90b483b9defb3f5fc Mon Sep 17 00:00:00 2001 From: Stijn Moreels <9039753+stijnmoreels@users.noreply.github.com> Date: Thu, 13 Jun 2024 06:18:03 +0200 Subject: [PATCH 2/2] pr-fix: updated wrong test assertion --- .../Arcus.Scripting.DevOps.tests.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Arcus.Scripting.Tests.Unit/Arcus.Scripting.DevOps.tests.ps1 b/src/Arcus.Scripting.Tests.Unit/Arcus.Scripting.DevOps.tests.ps1 index 6beefb14..974f9867 100644 --- a/src/Arcus.Scripting.Tests.Unit/Arcus.Scripting.DevOps.tests.ps1 +++ b/src/Arcus.Scripting.Tests.Unit/Arcus.Scripting.DevOps.tests.ps1 @@ -5,7 +5,7 @@ InModuleScope Arcus.Scripting.DevOps { Context "Setting ARM outputs to Azure DevOps variable group" { It "Setting DevOps variable should write to host" { # Arrange - Mock Write-Host { $Object | Should -Be "##vso[task.setvariable variable=test] value" } -Verifiable + Mock Write-Host { $Object | Should -Be "##vso[task.setvariable variable=test]value" } -Verifiable # Act Set-AzDevOpsVariable "test" "value" @@ -15,7 +15,7 @@ InModuleScope Arcus.Scripting.DevOps { } It "Setting DevOps variable as secret should write to host" { # Arrange - Mock Write-Host { $Object | Should -Be "##vso[task.setvariable variable=test;issecret=true] value" } -Verifiable + Mock Write-Host { $Object | Should -Be "##vso[task.setvariable variable=test;issecret=true]value" } -Verifiable # Act Set-AzDevOpsVariable "test" "value" -AsSecret