![]() ![]() ![]() $env:MyTestVariable = "My temporary test variable." The following one-liner performs this function: You create this type of variable using the $env: operation. The first one is a temporary variable that lasts only as long as your PowerShell session, allowing you to create a pointer to work with for the rest of your PowerShell script. There are a couple different types of environment variables that you can create. ![]() In a future article I'll wrap up this series on environment variables by working on deleting them. In this article, I'll show you how to quickly and easily create and modify environment variables. Once you have that mastered, it's time to move on to bigger and better things. In PowerShell One-Liner: Getting Local Environment Variables, I showed you how to use a single PowerShell command to get the full list of environment variables known to the operating system, and also how to retrieve just a single value.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |