Force PowerShell Module Path Variable in Existing Session

Update a PowerShell module path in an existing session.

John Savill

July 31, 2014

1 Min Read
path

Q: I updated the PowerShell module path, but how can I make it take effect in my current PowerShell session?

A: To force an update to the module path in an existing PowerShell session, run the following code:

$env:PSModulePath = [System.Environment]::GetEnvironmentVariable("PSModulePath","Machine")

About the Author

Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.

You May Also Like