summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rw-r--r--scripts/Operational-E2E.ps18
1 files changed, 8 insertions, 0 deletions
diff --git a/scripts/Operational-E2E.ps1 b/scripts/Operational-E2E.ps1
index 221e62d..c1b45a4 100644
--- a/scripts/Operational-E2E.ps1
+++ b/scripts/Operational-E2E.ps1
@@ -14,6 +14,8 @@ $originalTmp = $env:TMP
$originalDotnetCliHome = $env:DOTNET_CLI_HOME
$originalFirstTimeExperience = $env:DOTNET_SKIP_FIRST_TIME_EXPERIENCE
$originalTelemetry = $env:DOTNET_CLI_TELEMETRY_OPTOUT
+$originalAddGlobalToolsToPath = $env:DOTNET_ADD_GLOBAL_TOOLS_TO_PATH
+$originalUserPath = [Environment]::GetEnvironmentVariable('Path', 'User')
$repository = (Resolve-Path (Join-Path $PSScriptRoot '..')).Path
$zip = (Resolve-Path (Join-Path $repository $ReleaseZip)).Path
$root = Join-Path ([IO.Path]::GetTempPath()) ("agent-mcp-operational-e2e-" + [Guid]::NewGuid().ToString('N'))
@@ -59,6 +61,7 @@ public static class Program
$env:DOTNET_CLI_HOME = $sandboxCliHome
$env:DOTNET_SKIP_FIRST_TIME_EXPERIENCE = '1'
$env:DOTNET_CLI_TELEMETRY_OPTOUT = '1'
+ $env:DOTNET_ADD_GLOBAL_TOOLS_TO_PATH = 'false'
$dotnet = (Get-Command dotnet).Source
$dotnetRoot = Split-Path $dotnet
@@ -260,5 +263,10 @@ finally {
$env:DOTNET_CLI_HOME = $originalDotnetCliHome
$env:DOTNET_SKIP_FIRST_TIME_EXPERIENCE = $originalFirstTimeExperience
$env:DOTNET_CLI_TELEMETRY_OPTOUT = $originalTelemetry
+ $env:DOTNET_ADD_GLOBAL_TOOLS_TO_PATH = $originalAddGlobalToolsToPath
+ $currentUserPath = [Environment]::GetEnvironmentVariable('Path', 'User')
+ if ($currentUserPath -cne $originalUserPath) {
+ Write-Error 'Operational E2E changed the persistent user PATH.'
+ }
if ($passed) { Remove-Item -LiteralPath $root -Recurse -Force }
}