CmdID

CmdID / PowerShell / Cmdlets / Get

Get-Variable

Gets the variables in the current console. PowerShell reference

From the PowerShell reference 5 parameters Alias gv

Opens CmdID with your command, read as PowerShell. It is read in your browser and sent nowhere.

What it does

from the PowerShell reference, CC BY 4.0

Gets the variables in the current console. The Get-Variable cmdlet gets the PowerShell variables in the current console. You can retrieve just the values of the variables by specifying the ValueOnly parameter, and you can filter the variables returned by name.

Get-Variable [[-Name] <String[]>] [-ValueOnly] [-Include <String[]>] [-Exclude <String[]>] [-Scope <String>] [<CommonParameters>]

Get variables by letter

Get-Variable m*Identify

Get variable values by letter

Get-Variable m* -ValueOnlyIdentify

Get variables by two letters

Get-Variable -Include M*,P*Identify

Get variables by scope

Get-Variable -Scope 0 Compare-Object (Get-Variable -Scope 0) (Get-Variable -Scope 1)Identify

Its page in the reference: Get-Variable.

Parameters

5 in the PowerShell reference
-ExcludeSpecifies an array of items that this cmdlet excludes from the operation. Wildcards are permitted.
-IncludeSpecifies an array of items upon which the cmdlet will act, excluding all others. Wildcards are permitted.
-NameSpecifies the name of the variable. Wildcards are permitted. You can also pipe a variable name to Get-Variable.
-ScopeSpecifies the variables in the scope.The acceptable values for this parameter are: - Global - Local - Script - A number relative to the current scope (0 through the number of scopes, where 0 is the current scope and 1 is its parent) Local is the default. For more information, see about_Scopes.
-ValueOnlyIndicates that this cmdlet gets only the value of the variable.