Skip to content

Get PSModulePath

dscbot edited this page Jan 21, 2024 · 3 revisions

Get-PSModulePath

SYNOPSIS

Returns the environment variable PSModulePath from the specified target.

SYNTAX

Get-PSModulePath [-FromTarget] <String[]> [<CommonParameters>]

DESCRIPTION

Returns the environment variable PSModulePath from the specified target. If more than one target is provided the return will contain all the concatenation of all unique paths from the targets. If there are no paths to return the command will return an empty string.

EXAMPLES

EXAMPLE 1

Get-PSModulePath -FromTarget 'Session'

Returns the paths from the Session target.

EXAMPLE 2

Get-PSModulePath -FromTarget 'Session', 'User', 'Machine'

Returns the unique paths from the all targets.

PARAMETERS

-FromTarget

Specifies the target to get the PSModulePath from.

Type: String[]
Parameter Sets: (All)
Aliases:

Required: True
Position: 1
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]

If there are no paths to return the command will return an empty string.

NOTES

RELATED LINKS

Clone this wiki locally