en-US/about_xEnvironmentVariables.help.txt

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
<#
.SYNOPSIS
A PowerShell module to handle environment variables, supporting variable expansion. This function handles GETTING environment variables.
 
.DESCRIPTION
This module is capable of Retrieving Environment Variables in any scope (Process, User, Machine). It will return the value of the Envrionment Variable.
 
.PARAMETER Name
[String] Specify the name of the Environment Variable to retrieve.
 
.PARAMETER Scope
[System.EnvironmentVariableTarget], [String]
Specify the scope to search for the target Environment Variable.
 
Process : Environment Variables in the running process.
 
User : Environment Variables in the User Scope affect the Global Environment Variables for the current user.
 
Machine : Environment Variables in the Machine Scope change the settings in the registry for all users.
 
.PARAMETER Expanded
[Boolean]
Set to $true to expand any Environment Variables in the output of the command.
String : A simple string value
ExpandString : A string value which contains unexpanded environment variables in the syntax of %VARIABLENAME%. These variables will NOT be expanded when the value is read.
 
.PARAMETER ShowProperties
[Switch] If enabled this parameter will show the Name, Value, Scope, ValueType and (if a String containing an unexpanded Environment Variable) the BeforeExpansion properties and their respective values. Otherwise only the Value will be output as a string.
 
.EXAMPLE
PS C:\> Get-EnvironmentVariable -name TestVar -Scope Machine -ShowProperties
 
Name : TestVar
Value : TestValue
Scope : Machine
ValueType : String
BeforeExpansion :
 
.EXAMPLE
PS C:\> Get-EnvironmentVariable -name TestPathVar -Scope Machine -ShowProperties
 
Name : TestPathVar
Value : C:\Users\rblea\AppData\Local\Temp\TestValue2
Scope : Machine
ValueType : String
BeforeExpansion : %TEMP%\TestValue2
 
.EXAMPLE
PS C:\> Get-EnvironmentVariable -name TestPathVar -Scope Machine
C:\Users\USER\AppData\Local\Temp\TestValue2
 
.EXAMPLE
PS C:\> Get-EnvironmentVariable -name TestPathVar -Scope Machine -Expanded $false
%TEMP%\TestValue2
 
 
.INPUTS
[String],[System.EnvironmentVariableTarget],[Boolean]
 
.OUTPUTS
[Hashtable],[String]
 
.NOTES
 
.LINK
https://github.com/rbleattler/xEnvironmentVariables
 
#>