2021-09-23 09:09:41 -04:00
|
|
|
## Check if the MSP360 module needs to be installed
|
|
|
|
|
If (-not (Get-Module -ListAvailable -Name MSP360) ) {
|
|
|
|
|
|
|
|
|
|
LogMsg "Setting Powershell Execution Policy to Unrestricted for this script"
|
|
|
|
|
Try { Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Scope Process }
|
|
|
|
|
Catch { LogErr $_.Exception.Message }
|
|
|
|
|
|
|
|
|
|
LogMsg "Downloading and installing MSP360 Powershell module"
|
|
|
|
|
Try { [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; Invoke-Expression (New-Object System.Net.WebClient).DownloadString('https://git.io/JUSAA'); Install-MSP360Module }
|
|
|
|
|
Catch { LogErr $_.Exception.Message }
|
|
|
|
|
|
|
|
|
|
} Else { LogMsg "MSP360 Powershell module is already installed" }
|