diff --git a/images/windows/scripts/build/Configure-SystemEnvironment.ps1 b/images/windows/scripts/build/Configure-SystemEnvironment.ps1 index f3745ae40..aa280c352 100644 --- a/images/windows/scripts/build/Configure-SystemEnvironment.ps1 +++ b/images/windows/scripts/build/Configure-SystemEnvironment.ps1 @@ -3,7 +3,13 @@ ## Desc: Configures system environment variables ################################################################################ -setx ImageVersion $env:IMAGE_VERSION /m -setx ImageOS $env:IMAGE_OS /m -setx AGENT_TOOLSDIRECTORY $env:AGENT_TOOLSDIRECTORY /m -setx ACTIONS_RUNNER_ACTION_ARCHIVE_CACHE $env:ACTIONS_RUNNER_ACTION_ARCHIVE_CACHE /m +$variables = @{ + "ImageVersion" = $env:IMAGE_VERSION + "ImageOS" = $env:IMAGE_OS + "AGENT_TOOLSDIRECTORY" = $env:AGENT_TOOLSDIRECTORY + "ACTIONS_RUNNER_ACTION_ARCHIVE_CACHE" = $env:ACTIONS_RUNNER_ACTION_ARCHIVE_CACHE +} + +$variables.GetEnumerator() | ForEach-Object { + [Environment]::SetEnvironmentVariable($_.Key, $_.Value, "Machine") +} diff --git a/images/windows/scripts/build/Configure-Toolset.ps1 b/images/windows/scripts/build/Configure-Toolset.ps1 index c2e9e776f..119e72325 100644 --- a/images/windows/scripts/build/Configure-Toolset.ps1 +++ b/images/windows/scripts/build/Configure-Toolset.ps1 @@ -23,7 +23,7 @@ Function Set-DefaultVariables if (-not ([string]::IsNullOrEmpty($EnvVars.defaultVariable))) { - setx $toolEnvVars.defaultVariable $ToolVersionPath /M | Out-Null + [Environment]::SetEnvironmentVariable($toolEnvVars.defaultVariable, $ToolVersionPath, "Machine") } } @@ -48,20 +48,17 @@ $tools = Get-ToolsetContent | Select-Object -ExpandProperty toolcache ` | Where-Object { $toolsToConfigure -contains $_.name } Write-Host "Configure toolset tools environment..." -foreach ($tool in $tools) -{ +foreach ($tool in $tools) { $toolEnvVars = $toolsEnvironmentVariables[$tool.name] - if (-not ([string]::IsNullOrEmpty($toolEnvVars.variableTemplate))) - { - foreach ($version in $tool.versions) - { + if (-not ([string]::IsNullOrEmpty($toolEnvVars.variableTemplate))) { + foreach ($version in $tool.versions) { Write-Host "Set $($tool.name) $version environment variable..." $foundVersionArchPath = Get-ToolsetToolFullPath -Name $tool.name -Version $version -Arch $tool.arch $envName = $toolEnvVars.variableTemplate -f $version.Split(".") - setx $envName $foundVersionArchPath /M | Out-Null + [Environment]::SetEnvironmentVariable($envName, $foundVersionArchPath, "Machine") } } diff --git a/images/windows/scripts/build/Install-AndroidSDK.ps1 b/images/windows/scripts/build/Install-AndroidSDK.ps1 index ed7b859d6..83580d9a0 100644 --- a/images/windows/scripts/build/Install-AndroidSDK.ps1 +++ b/images/windows/scripts/build/Install-AndroidSDK.ps1 @@ -120,16 +120,16 @@ $ndkDefaultVersion = ($androidNDKs | Where-Object { $_ -match "ndk;$ndkDefaultMa $ndkRoot = "$sdkRoot\ndk\$ndkDefaultVersion" # Create env variables -setx ANDROID_HOME $sdkRoot /M -setx ANDROID_SDK_ROOT $sdkRoot /M +[Environment]::SetEnvironmentVariable("ANDROID_HOME", $sdkRoot, "Machine") +[Environment]::SetEnvironmentVariable("ANDROID_SDK_ROOT", $sdkRoot, "Machine") # ANDROID_NDK, ANDROID_NDK_HOME, and ANDROID_NDK_ROOT variables should be set as many customer builds depend on them https://github.com/actions/runner-images/issues/5879 -setx ANDROID_NDK $ndkRoot /M -setx ANDROID_NDK_HOME $ndkRoot /M -setx ANDROID_NDK_ROOT $ndkRoot /M +[Environment]::SetEnvironmentVariable("ANDROID_NDK", $ndkRoot, "Machine") +[Environment]::SetEnvironmentVariable("ANDROID_NDK_HOME", $ndkRoot, "Machine") +[Environment]::SetEnvironmentVariable("ANDROID_NDK_ROOT", $ndkRoot, "Machine") $ndkLatestPath = "$sdkRoot\ndk\$ndkLatestVersion" if (Test-Path $ndkLatestPath) { - setx ANDROID_NDK_LATEST_HOME $ndkLatestPath /M + [Environment]::SetEnvironmentVariable("ANDROID_NDK_LATEST_HOME", $ndkLatestPath, "Machine") } else { Write-Host "Latest NDK $ndkLatestVersion is not installed at path $ndkLatestPath" exit 1 diff --git a/images/windows/scripts/build/Install-Chrome.ps1 b/images/windows/scripts/build/Install-Chrome.ps1 index 7ef364919..2a2341f3c 100644 --- a/images/windows/scripts/build/Install-Chrome.ps1 +++ b/images/windows/scripts/build/Install-Chrome.ps1 @@ -78,7 +78,7 @@ Write-Host "Expand Chrome WebDriver archive (without using directory names)..." Extract-7Zip -Path $ChromeDriverArchPath -DestinationPath $ChromeDriverPath -ExtractMethod "e" Write-Host "Setting the environment variables..." -setx ChromeWebDriver "$ChromeDriverPath" /M +[Environment]::SetEnvironmentVariable("ChromeWebDriver", $ChromeDriverPath, "Machine") $regEnvKey = 'HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\' $PathValue = Get-ItemPropertyValue -Path $regEnvKey -Name 'Path' diff --git a/images/windows/scripts/build/Install-DotnetSDK.ps1 b/images/windows/scripts/build/Install-DotnetSDK.ps1 index b1f7abeaa..f47fbe370 100644 --- a/images/windows/scripts/build/Install-DotnetSDK.ps1 +++ b/images/windows/scripts/build/Install-DotnetSDK.ps1 @@ -6,9 +6,9 @@ ################################################################################ # Set environment variables -Set-SystemVariable -SystemVariable DOTNET_MULTILEVEL_LOOKUP -Value "0" -Set-SystemVariable -SystemVariable DOTNET_NOLOGO -Value "1" -Set-SystemVariable -SystemVariable DOTNET_SKIP_FIRST_TIME_EXPERIENCE -Value "1" +[System.Environment]::SetEnvironmentVariable("DOTNET_MULTILEVEL_LOOKUP", "0", "Machine") +[System.Environment]::SetEnvironmentVariable("DOTNET_NOLOGO", "1", "Machine") +[System.Environment]::SetEnvironmentVariable("DOTNET_SKIP_FIRST_TIME_EXPERIENCE", "1", "Machine") [Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor "Tls12" diff --git a/images/windows/scripts/build/Install-EdgeDriver.ps1 b/images/windows/scripts/build/Install-EdgeDriver.ps1 index ff6af450d..6aa74c0b2 100644 --- a/images/windows/scripts/build/Install-EdgeDriver.ps1 +++ b/images/windows/scripts/build/Install-EdgeDriver.ps1 @@ -38,7 +38,7 @@ $EdgeDriverSignatureThumbprint = ("7C94971221A799907BB45665663BBFD587BAC9F8", "7 Test-FileSignature -FilePath "$EdgeDriverPath\msedgedriver.exe" -ExpectedThumbprint $EdgeDriverSignatureThumbprint Write-Host "Setting the environment variables..." -setx EdgeWebDriver "$EdgeDriverPath" /M +[Environment]::SetEnvironmentVariable("EdgeWebDriver", $EdgeDriverPath, "Machine") $regEnvKey = 'HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\' $PathValue = Get-ItemPropertyValue -Path $regEnvKey -Name 'Path' diff --git a/images/windows/scripts/build/Install-Firefox.ps1 b/images/windows/scripts/build/Install-Firefox.ps1 index ea2332678..11a7d6f4f 100644 --- a/images/windows/scripts/build/Install-Firefox.ps1 +++ b/images/windows/scripts/build/Install-Firefox.ps1 @@ -58,6 +58,6 @@ Test-FileSignature -FilePath "$GeckoDriverPath/geckodriver.exe" -ExpectedThumbpr Write-Host "Setting the environment variables..." Add-MachinePathItem -PathItem $GeckoDriverPath -setx GeckoWebDriver "$GeckoDriverPath" /M +[Environment]::SetEnvironmentVariable("GeckoWebDriver", $GeckoDriverPath, "Machine") Invoke-PesterTests -TestFile "Browsers" -TestName "Firefox" diff --git a/images/windows/scripts/build/Install-Haskell.ps1 b/images/windows/scripts/build/Install-Haskell.ps1 index 07317ddd9..8fee875bc 100644 --- a/images/windows/scripts/build/Install-Haskell.ps1 +++ b/images/windows/scripts/build/Install-Haskell.ps1 @@ -23,9 +23,9 @@ New-Item -Path "$ghcupPrefix\ghcup" -ItemType 'directory' -ErrorAction SilentlyC New-Item -Path "$ghcupPrefix\ghcup\bin" -ItemType 'directory' -ErrorAction SilentlyContinue | Out-Null Start-DownloadWithRetry -Url $ghcupDownloadURL -Name "ghcup.exe" -DownloadPath "$ghcupPrefix\ghcup\bin" -Set-SystemVariable "GHCUP_INSTALL_BASE_PREFIX" $ghcupPrefix -Set-SystemVariable "GHCUP_MSYS2" $msysPath -Set-SystemVariable "CABAL_DIR" $cabalDir +[System.Environment]::SetEnvironmentVariable("GHCUP_INSTALL_BASE_PREFIX", $ghcupPrefix, "Machine") +[System.Environment]::SetEnvironmentVariable("GHCUP_MSYS2", $msysPath, "Machine") +[System.Environment]::SetEnvironmentVariable("CABAL_DIR", $cabalDir, "Machine") Add-MachinePathItem "$ghcupPrefix\ghcup\bin" Add-MachinePathItem "$cabalDir\bin" diff --git a/images/windows/scripts/build/Install-IEWebDriver.ps1 b/images/windows/scripts/build/Install-IEWebDriver.ps1 index e7d34f632..dac9756e9 100644 --- a/images/windows/scripts/build/Install-IEWebDriver.ps1 +++ b/images/windows/scripts/build/Install-IEWebDriver.ps1 @@ -33,6 +33,6 @@ Write-Host "Get the IEDriver version..." (Get-Item "$ieDriverPath\IEDriverServer.exe").VersionInfo.FileVersion | Out-File -FilePath "$ieDriverPath\versioninfo.txt" Write-Host "Setting the IEWebDriver environment variables" -setx IEWebDriver $ieDriverPath /M +[Environment]::SetEnvironmentVariable("IEWebDriver", $ieDriverPath, "Machine") Invoke-PesterTests -TestFile "Browsers" -TestName "Internet Explorer" diff --git a/images/windows/scripts/build/Install-JavaTools.ps1 b/images/windows/scripts/build/Install-JavaTools.ps1 index d56d50358..9696fd9f5 100644 --- a/images/windows/scripts/build/Install-JavaTools.ps1 +++ b/images/windows/scripts/build/Install-JavaTools.ps1 @@ -20,7 +20,7 @@ function Set-JavaPath { } Write-Host "Set 'JAVA_HOME_${Version}_X64' environmental variable as $javaPath" - setx JAVA_HOME_${Version}_X64 $javaPath /M + [Environment]::SetEnvironmentVariable("JAVA_HOME_${Version}_X64", $javaPath, "Machine") if ($Default) { # Clean up any other Java folders from PATH to make sure that they won't conflict with each other @@ -42,7 +42,7 @@ function Set-JavaPath { Set-MachinePath -NewPath $newPath Write-Host "Set JAVA_HOME environmental variable as $javaPath" - setx JAVA_HOME $javaPath /M + [Environment]::SetEnvironmentVariable("JAVA_HOME", $javaPath, "Machine") } } @@ -129,9 +129,9 @@ $maven_opts = '-Xms256m' $m2_repo = 'C:\ProgramData\m2' New-Item -Path $m2_repo -ItemType Directory -Force | Out-Null -setx M2 $m2 /M -setx M2_REPO $m2_repo /M -setx MAVEN_OPTS $maven_opts /M +[Environment]::SetEnvironmentVariable("M2", $m2, "Machine") +[Environment]::SetEnvironmentVariable("M2_REPO", $m2_repo, "Machine") +[Environment]::SetEnvironmentVariable("MAVEN_OPTS", $maven_opts, "Machine") # Download cobertura jars $uri = 'https://repo1.maven.org/maven2/net/sourceforge/cobertura/cobertura/2.1.1/cobertura-2.1.1-bin.zip' @@ -143,6 +143,6 @@ $fileHash = (Get-FileHash -Path $archivePath -Algorithm SHA256).Hash Use-ChecksumComparison $fileHash $sha256sum Extract-7Zip -Path $archivePath -DestinationPath "C:\" -setx COBERTURA_HOME $coberturaPath /M +[Environment]::SetEnvironmentVariable("COBERTURA_HOME", $coberturaPath, "Machine") Invoke-PesterTests -TestFile "Java" diff --git a/images/windows/scripts/build/Install-Miniconda.ps1 b/images/windows/scripts/build/Install-Miniconda.ps1 index 746723e5c..e81eeeaab 100644 --- a/images/windows/scripts/build/Install-Miniconda.ps1 +++ b/images/windows/scripts/build/Install-Miniconda.ps1 @@ -12,7 +12,7 @@ $InstallerUrl = "https://repo.anaconda.com/miniconda/${InstallerName}" $ArgumentList = ("/S", "/AddToPath=0", "/RegisterPython=0", "/D=$CondaDestination") Install-Binary -Url $InstallerUrl -Name $InstallerName -ArgumentList $ArgumentList -Set-SystemVariable -SystemVariable "CONDA" -Value $CondaDestination +[System.Environment]::SetEnvironmentVariable("CONDA", $CondaDestination, "Machine") #region Supply chain security $localFileHash = (Get-FileHash -Path (Join-Path ${env:TEMP} $installerName) -Algorithm SHA256).Hash diff --git a/images/windows/scripts/build/Install-NodeJS.ps1 b/images/windows/scripts/build/Install-NodeJS.ps1 index 37840ad31..5487ff9ce 100644 --- a/images/windows/scripts/build/Install-NodeJS.ps1 +++ b/images/windows/scripts/build/Install-NodeJS.ps1 @@ -18,7 +18,7 @@ Choco-Install -PackageName nodejs -ArgumentList "--version=$versionToInstall" Add-MachinePathItem $PrefixPath $env:Path = Get-MachinePath -setx npm_config_prefix $PrefixPath /M +[Environment]::SetEnvironmentVariable("npm_config_prefix", $PrefixPath, "Machine") $env:npm_config_prefix = $PrefixPath npm config set cache $CachePath --global diff --git a/images/windows/scripts/build/Install-PHP.ps1 b/images/windows/scripts/build/Install-PHP.ps1 index 40b1bcc08..c8b5ffea1 100644 --- a/images/windows/scripts/build/Install-PHP.ps1 +++ b/images/windows/scripts/build/Install-PHP.ps1 @@ -16,7 +16,7 @@ Choco-Install -PackageName composer -ArgumentList "--ia", "/DEV=$installDir /PHP ((Get-Content -path $installDir\php.ini -Raw) -replace ';extension=curl','extension=curl' -replace ';extension=mbstring','extension=mbstring' -replace ';extension_dir = "ext"','extension_dir = "ext"' -replace ';extension=openssl','extension=openssl') | Set-Content -Path $installDir\php.ini # Set the PHPROOT environment variable. -setx PHPROOT $installDir /M +[Environment]::SetEnvironmentVariable("PHPROOT", $installDir, "Machine") # Invoke Pester Tests Invoke-PesterTests -TestFile "PHP" diff --git a/images/windows/scripts/build/Install-Pipx.ps1 b/images/windows/scripts/build/Install-Pipx.ps1 index e4babf990..fb86d7166 100644 --- a/images/windows/scripts/build/Install-Pipx.ps1 +++ b/images/windows/scripts/build/Install-Pipx.ps1 @@ -10,8 +10,8 @@ $env:PIPX_HOME = "${env:ProgramFiles(x86)}\pipx" pip install pipx Add-MachinePathItem "${env:PIPX_BIN_DIR}" -Set-SystemVariable -SystemVariable PIPX_BIN_DIR -Value $env:PIPX_BIN_DIR -Set-SystemVariable -SystemVariable PIPX_HOME -Value $env:PIPX_HOME +[System.Environment]::SetEnvironmentVariable("PIPX_BIN_DIR", $env:PIPX_BIN_DIR, "Machine") +[System.Environment]::SetEnvironmentVariable("PIPX_HOME", $env:PIPX_HOME, "Machine") Invoke-PesterTests -TestFile "Tools" -TestName "Pipx" diff --git a/images/windows/scripts/build/Install-PostgreSQL.ps1 b/images/windows/scripts/build/Install-PostgreSQL.ps1 index 40fd2e00f..f4d72d9c7 100644 --- a/images/windows/scripts/build/Install-PostgreSQL.ps1 +++ b/images/windows/scripts/build/Install-PostgreSQL.ps1 @@ -3,22 +3,22 @@ $pgUser = "postgres" $pgPwd = "root" # Prepare environment variable for validation -Set-SystemVariable -SystemVariable PGUSER -Value $pgUser -Set-SystemVariable -SystemVariable PGPASSWORD -Value $pgPwd +[System.Environment]::SetEnvironmentVariable("PGUSER", $pgUser, "Machine") +[System.Environment]::SetEnvironmentVariable("PGPASSWORD", $pgPwd, "Machine") # Define latest available version to install based on version specified in the toolset $toolsetVersion = (Get-ToolsetContent).postgresql.version -$getPostgreReleases = Invoke-WebRequest -Uri "https://git.postgresql.org/gitweb/?p=postgresql.git;a=tags" -UseBasicParsing +$getPostgreReleases = Invoke-WebRequest -Uri "https://git.postgresql.org/gitweb/?p=postgresql.git;a=tags" -UseBasicParsing # Getting all links matched to the pattern (e.g.a=log;h=refs/tags/REL_14) -$TargetReleases = $getPostgreReleases.Links.href | Where-Object {$_ -match "a=log;h=refs/tags/REL_$toolsetVersion"} +$TargetReleases = $getPostgreReleases.Links.href | Where-Object { $_ -match "a=log;h=refs/tags/REL_$toolsetVersion" } [Int32]$OutNumber = $null $MinorVersions = @() foreach ($release in $TargetReleases) { - $version = $release.split('/')[-1] - # Checking if the latest symbol of the release version is actually a number. If yes, add to $MinorVersions array - if ([Int32]::TryParse($($version.Split('_')[-1]),[ref]$OutNumber)){ - $MinorVersions += $OutNumber - } + $version = $release.split('/')[-1] + # Checking if the latest symbol of the release version is actually a number. If yes, add to $MinorVersions array + if ([Int32]::TryParse($($version.Split('_')[-1]), [ref]$OutNumber)) { + $MinorVersions += $OutNumber + } } # Sorting and getting the last one $TargetMinorVersions = ($MinorVersions | Sort-Object)[-1] @@ -47,7 +47,7 @@ do { # Return the previous value of ErrorAction and invoke Install-Binary function $ErrorActionPreference = $ErrorActionOldValue $InstallerName = $InstallerUrl.Split('/')[-1] -$ArgumentList = ("--install_runtimes 0","--superpassword root","--enable_acledit 1","--unattendedmodeui none","--mode unattended") +$ArgumentList = ("--install_runtimes 0", "--superpassword root", "--enable_acledit 1", "--unattendedmodeui none", "--mode unattended") Install-Binary -Url $InstallerUrl -Name $InstallerName -ArgumentList $ArgumentList -ExpectedSignature (Get-ToolsetContent).postgresql.signature # Get Path to pg_ctl.exe @@ -63,16 +63,15 @@ $pgReadyPath = Join-Path $pgBin "pg_isready.exe" $pgReady = Start-Process -FilePath $pgReadyPath -Wait -PassThru $exitCode = $pgReady.ExitCode -if ($exitCode -ne 0) -{ +if ($exitCode -ne 0) { Write-Host -Object "PostgreSQL is not ready. Exitcode: $exitCode" exit $exitCode } # Added PostgreSQL environment variable -Set-SystemVariable -SystemVariable PGBIN -Value $pgBin -Set-SystemVariable -SystemVariable PGROOT -Value $pgRoot -Set-SystemVariable -SystemVariable PGDATA -Value $pgData +[System.Environment]::SetEnvironmentVariable("PGBIN", $pgBin, "Machine") +[System.Environment]::SetEnvironmentVariable("PGROOT", $pgRoot, "Machine") +[System.Environment]::SetEnvironmentVariable("PGDATA", $pgData, "Machine") # Stop and disable PostgreSQL service $pgService = Get-Service -Name postgresql* diff --git a/images/windows/scripts/build/Install-Selenium.ps1 b/images/windows/scripts/build/Install-Selenium.ps1 index 7a1043f66..2c321c8a2 100644 --- a/images/windows/scripts/build/Install-Selenium.ps1 +++ b/images/windows/scripts/build/Install-Selenium.ps1 @@ -27,6 +27,6 @@ New-Item -Path $seleniumDirectory -Name "$seleniumBinaryName-$seleniumFullVersio # Add SELENIUM_JAR_PATH environment variable $seleniumBinPath = Join-Path $seleniumDirectory $seleniumFileName -setx "SELENIUM_JAR_PATH" "$($seleniumBinPath)" /M +[Environment]::SetEnvironmentVariable("SELENIUM_JAR_PATH", $seleniumBinPath, "Machine") Invoke-PesterTests -TestFile "Browsers" -TestName "Selenium" diff --git a/images/windows/scripts/build/Install-Vcpkg.ps1 b/images/windows/scripts/build/Install-Vcpkg.ps1 index 76e7d24f5..ef93073ac 100644 --- a/images/windows/scripts/build/Install-Vcpkg.ps1 +++ b/images/windows/scripts/build/Install-Vcpkg.ps1 @@ -16,6 +16,6 @@ Invoke-Expression "$InstallDir\$VcpkgExecPath integrate install" # Add vcpkg to system environment Add-MachinePathItem $InstallDir $env:Path = Get-MachinePath -setx VCPKG_INSTALLATION_ROOT $InstallDir /M +[Environment]::SetEnvironmentVariable("VCPKG_INSTALLATION_ROOT", $InstallDir, "Machine") Invoke-PesterTests -TestFile "Tools" -TestName "Vcpkg" diff --git a/images/windows/scripts/helpers/ImageHelpers.psm1 b/images/windows/scripts/helpers/ImageHelpers.psm1 index ec7959cc7..e7136d319 100644 --- a/images/windows/scripts/helpers/ImageHelpers.psm1 +++ b/images/windows/scripts/helpers/ImageHelpers.psm1 @@ -19,7 +19,6 @@ Export-ModuleMember -Function @( 'Add-DefaultItem' 'Get-SystemVariable' 'Get-DefaultVariable' - 'Set-SystemVariable' 'Set-DefaultVariable' 'Install-Binary' 'Install-VisualStudio' diff --git a/images/windows/scripts/helpers/PathHelpers.ps1 b/images/windows/scripts/helpers/PathHelpers.ps1 index df7ce10ed..ca3a004ac 100644 --- a/images/windows/scripts/helpers/PathHelpers.ps1 +++ b/images/windows/scripts/helpers/PathHelpers.ps1 @@ -54,16 +54,6 @@ function Get-DefaultVariable { [System.GC]::Collect() } -function Set-SystemVariable { - param( - [string]$SystemVariable, - [string]$Value - ) - - [System.Environment]::SetEnvironmentVariable($SystemVariable, $Value, "Machine") - Get-SystemVariable $SystemVariable -} - function Set-DefaultVariable { param( [string]$DefaultVariable, @@ -93,7 +83,7 @@ function Set-MachinePath { [string]$NewPath ) - Set-SystemVariable PATH $NewPath + [System.Environment]::SetEnvironmentVariable("PATH", $NewPath, "Machine") } function Set-DefaultPath { diff --git a/images/windows/scripts/helpers/test/PathHelpers.Tests.ps1 b/images/windows/scripts/helpers/test/PathHelpers.Tests.ps1 index bbde2e226..bdbbb2aa0 100644 --- a/images/windows/scripts/helpers/test/PathHelpers.Tests.ps1 +++ b/images/windows/scripts/helpers/test/PathHelpers.Tests.ps1 @@ -25,10 +25,3 @@ Describe "Add-MachinePathItem Tests"{ Add-MachinePathItem -PathItem 'C:\baz' | Should Be 'C:\baz;C:\foo;C:\bar' } } - -Describe 'Set-SystemVariable Tests' { - Mock Set-ItemProperty {return} - It 'Set-SystemVariable should return new path' { - Set-SystemVariable -SystemVariable "NewPathVar" -Value "C:\baz" | Should Be "C:\baz" - } -}