SHARE
TWEET

Untitled

a guest Jan 12th, 2017 60 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $originalpaths = (Get-ItemProperty -Path ‘Registry::HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment’ -Name PSModulePath).PSModulePath
  2.  
  3. # Add your new path to below after the ;
  4.  
  5. $newPath=$originalpaths+’;C:\PowerShell\Modules\’
  6.  
  7. Set-ItemProperty -Path ‘Registry::HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment’ -Name PSModulePath –Value $newPath
RAW Paste Data
Top