Add-ModulePath
SYNOPSIS
Adds a folder to the powershell modules path.
SYNTAX
Add-ModulePath [-Path] <String[]> [-ActiveSessionOnly] [<CommonParameters>]
DESCRIPTION
The Add-ModulePath function uses the registry to add folders to the powershell modules path.
EXAMPLES
Example 1
@{paragraph=PS C:\>}
Add-ModulePath "D:\MyFolder"
Add D:\MyFolder to the powershell modules path.
Example 2
@{paragraph=PS C:\>}
Add-ModulePath -Path "C:\App1","D:\App2"
Add C:\App1 and D:\App2 to the powershell modules path
PARAMETERS
-Path
The path to add the powershell modules 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
Add the path to the modules path for the current session only.
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, you need to start a new powershell window in order for changes to take affect.