Would you like to learn how to create an environment variable using Powershell? In this tutorial, we are going to show you how to use Powershell to create an environment variable on a computer running Windows.

• Windows 2012 R2
• Windows 2016
• Windows 2019
• Windows 10

Equipment list

The following section presents the list of equipment used to create this tutorial.

As an Amazon Associate, I earn from qualifying purchases.

Related tutorial - PowerShell

On this page, we offer quick access to a list of tutorials related to PowerShell.

Tutorial Powershell - Creating an Environment variable

As an Administrator, start a new POWERSHELL command-line prompt.

Powershell on Start menu

Create an environment variable.

Copy to Clipboard

In our example, we created a persistent environment variable named: VAR_TEST.

Change the environment variable name and its content to reflect your needs.

Verify the existence of the environment variable.

Copy to Clipboard

Here is the output:

Copy to Clipboard

Congratulations! You are able to create an environment variable using Powershell.