Get-EnvironmentVariableNames

Get-EnvironmentVariableNames

Get-EnvironmentVariableNames

Gets all environment variable names.

Syntax

Get-EnvironmentVariableNames `
  [-Scope {Process | User | Machine}]

Description

Provides a list of environment variable names based on the scope. This can be used to loop through the list and generate names.

Notes

Process dumps the current environment variable names in memory / session. The other scopes refer to the registry values.

Aliases

None

Examples

EXAMPLE 1

Get-EnvironmentVariableNames -Scope Machine

Inputs

None

Outputs

  • A list of environment variables names.

Parameters

-Scope

The environment variable target scope. This is Process, User, or Machine.

Valid options: Process, User, Machine

Property Value
Aliases
Required? false
Position? 1
Default Value
Accept Pipeline Input? false

Function Reference

📝 NOTE This documentation has been automatically generated from Import-Module "$env:ChocolateyInstall\helpers\chocolateyInstaller.psm1" -Force; Get-Help Get-EnvironmentVariableNames -Full.

View the source for Get-EnvironmentVariableNames