How To Work With Environment Variables In PowerShell. If you enjoyed this video, be sure to head over to http://techsnips.io to get free access to our entire library of content!
Working with environment variables can be a real pain sometimes. In this Snip we'll learn how to create, change, remove environment variables with PowerShell. We'll take a look the environment provider and how we can interact with it like we are used to interacting with the filesystem with commands like Get-ChildItem and Get-Item. A common problem is updating the PATH environment variable. We'll see why the changes don't remain persistent and how we can work around it so we don't need to open it in every new PowerShell session! Last we'll talk about environment variables that store preferences, like PSModulePath. Finally we'll see how we can use [System.Environment] to make changes as well.
Tags: How To Work With Environment Variables In PowerShell, powershell, windows powershell, scripting, command line, cmdlet, tutorial, how-to, automation, sysadmin, Get-ChildItem, Get-Item, PATH, PSModulePath