Returns the path to the directory where you can install custom modules.
Get-PowerShellModuleInstallPath [<CommonParameters>]
Custom modules should be installed under the Program Files
directory. This function looks at the PSModulePath
environment variable to find the install location under Program Files
. If that path isn't part of the PSModulePath
environment variable, returns the module path under $PSHOME
. If that isn't part of the PSModulePath
environment variable, an error is written and nothing is returned.
Get-PowerShellModuleInstallPath
is new in Carbon 2.0.
Get-PowerShellModuleInstallPath
Demonstrates how to get the path where modules should be installed.