This commit is contained in:
2020-08-14 14:19:37 -04:00
parent d18f8dad97
commit f2b358d8dd
24 changed files with 253 additions and 180 deletions
+5 -4
View File
@@ -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" }