title: Access System Environment Variables in Azure Pipeline Powershell Script Task
body: <p>We are using powershell to do some deployment tasks in the target environment(e.g. a VM).
  However, it seems the script does not have access to the system environment variables, as well as other programs run by the script.
  So far, it only has access to the variables defined in the pipeline.</p>
  
  <p>Also, inside the .NET program run by that script, we have:</p>
  
  <p><code>var env = Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT", EnvironmentVariableTarget.Machine);</code></p>
  
  <p>but it still does not have access to the desired environment variable.</p>
  
  <p>Is there a way we can allow the pipeline script to access the system variable?
  Or, do we have to define a stage-scoped pipeline variable and make it consistent with the targeting machine's system variable?</p>
  
  <p>Thanks.</p>