Advertisement
Guest User

Untitled

a guest
Sep 21st, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  1. $VarFile = Join-Path $ENV:SystemDrive '\Windows\Temp\TSVariables.txt'
  2. $TSEnv = New-Object -ComObject Microsoft.SMS.TSEnvironment
  3. $Vars = $TSEnv.GetVariables()
  4. $Output = foreach ($Var in $Vars)
  5. {
  6. '{0} = {1}' -f $Var, $TSEnv.Value($Var)
  7. }
  8. $Output | Out-File -FilePath $VarFile
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement