21.5. Summary

The values of environment variables are exposed in the env: drive by the Windows PowerShell Environment provider.

To retrieve the value of environment variables, you can use the get-childitem cmdlet or use the variable syntax of the form $env:variableName.

To change the value of an environment variable for the duration of a PowerShell session, use the appropriate Windows PowerShell assignment operator.

Get Professional Windows® PowerShell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.