xxxxxxxxxx
$variables = [ordered]@{
POWERSHELL_CLI_TELEMETRY_OPTOUT = "1"
POWERSHELL_TELEMETRY_OPTOUT = "1"
POWERSHELL_UPDATECHECK = "Off"
POWERSHELL_UPDATECHECK_OPTOUT = "1"
DOTNET_CLI_TELEMETRY_OPTOUT = "1"
DOTNET_TELEMETRY_OPTOUT = "1"
COMPlus_EnableDiagnostics = "0"
}
foreach ($target in "User","Machine") {
write-Host "Target: $target" -foregroundcolor cyan
foreach ($key in $variables.Keys) {
write-Host " $key = $($variables.$Key)"
[Environment]::SetEnvironmentVariable($key,$variables.$Key, $target)
}
}