Skip to content
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
21 lines (13 sloc) 669 Bytes
# Adds the SPE Modules path to the PSModulePath Environment Variable, for use with SPE Remoting.
$speModulePath = Join-Path $PSScriptRoot "Modules"
$envModulePath = [Environment]::GetEnvironmentVariable("PSModulePath", "Machine")
if($envModulePath -notlike "*$($speModulePath)*") {
[Environment]::SetEnvironmentVariable("PSModulePath", $envModulePath.TrimEnd(";") + ";$($speModulePath)", "Machine")
$env:PSModulePath = $env:PSModulePath.TrimEnd(";") + ";$($speModulePath)"
Write-Host "PSModulePath environment variable updated with $speModulePath"
Write-Host "PSModulePath environment variable already contains $speModulePath"
You can’t perform that action at this time.