update
This commit is contained in:
+5
-4
@@ -13,12 +13,17 @@ If ( Test-Path ${Env:ProgramData} )
|
||||
|
||||
## Set the path to this module and make the directory for it
|
||||
$ModulePath = "${RootDir}\Scripts\${ModuleName}"
|
||||
|
||||
## Create the path to the module
|
||||
If ( !(Test-Path $ModulePath) )
|
||||
{
|
||||
Try { New-Item -Path $ModulePath -ItemType Directory -Force | Out-Null }
|
||||
Catch { Write-Output $_.Exception.Message }
|
||||
}
|
||||
|
||||
## Set the environment variable to the module
|
||||
[System.Environment]::SetEnvironmentVariable('MSPPSModule',"${RootDir}\Scripts\${ModuleName}",[System.EnvironmentVariableTarget]::Machine)
|
||||
|
||||
## Make sure all the management directories exist
|
||||
If ( !(Test-Path $RootDir) )
|
||||
{
|
||||
@@ -47,7 +52,3 @@ If ( !(Test-Path "${RootDir}\Logs") )
|
||||
## Download the module file
|
||||
Try { (New-Object Net.WebClient).DownloadFile($ModuleURL, "${RootDir}\Scripts\${ModuleName}\${ModuleName}.psm1") }
|
||||
Catch { Write-Output $_.Exception.Message }
|
||||
|
||||
## Import the new module to test
|
||||
If ( Test-Path "${RootDir}\Scripts\${ModuleName}\${ModuleName}.psm1" )
|
||||
{ Import-Module -Name "${RootDir}\Scripts\${ModuleName}\${ModuleName}.psm1" }
|
||||
Reference in New Issue
Block a user