Skip to content

Get-EnvironmentPath

SYNOPSIS

Get the PATH environment variable.

SYNTAX

AsString (Default)

Get-EnvironmentPath [-Scope <String>] [-ProgressAction <ActionPreference>] [<CommonParameters>]

AsArray

Get-EnvironmentPath [-Scope <String>] [-AsArray] [-ProgressAction <ActionPreference>] [<CommonParameters>]

DESCRIPTION

Get the PATH environment variable for the current user or all users.

EXAMPLES

EXAMPLE 1

Get-EnvironmentPath -Scope CurrentUser

Get the PATH environment variable for the current user.

EXAMPLE 2

Get-EnvironmentPath -Scope AllUsers -AsArray

Get the PATH environment variable for the current user as an array.

PARAMETERS

-Scope

The scope of the environment variable.

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: CurrentUser
Accept pipeline input: False
Accept wildcard characters: False

-AsArray

Return the environment variable as an array.

Type: SwitchParameter
Parameter Sets: AsArray
Aliases:

Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False

-ProgressAction

{{ Fill ProgressAction Description }}

Type: ActionPreference
Parameter Sets: (All)
Aliases: proga

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

INPUTS

OUTPUTS

System.String[]

System.String

NOTES