Skip to content

Remove-ModulePath

SYNOPSIS

Removes a folder from the powershell module path.

SYNTAX

Remove-ModulePath [-Path] <String[]> [-ActiveSessionOnly] [<CommonParameters>]

DESCRIPTION

The Remove-ModulePath function uses the registry to remove folders from the powershell module path.

EXAMPLES

Example 1

@{paragraph=PS C:\>}

Remove-ModulePath "D:\MyFolder"

Remove D:\MyFolder from the powershell modules path

Example 2

@{paragraph=PS C:\>}

Remove-ModulePath -Path "C:\App1","D:\App2"

Remove C:\App1 and D:\App2 from the powershell modules path

PARAMETERS

-Path

The path to remove from the powershell module path variable.

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

Required: True
Position: 0
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False

-ActiveSessionOnly

The path to remove from the current sessions powershell module path.

Type: System.Management.Automation.SwitchParameter
Parameter Sets: (All)
Aliases:

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

NOTES

You need to run this function as a member of the Administrators group. Moreover, a new powershell window may be required in order for changes to take affect.

Back to top