Files
management-scripts/Install-MSP360PowershellModule.ps1
T

13 lines
691 B
PowerShell
Raw Normal View History

## 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" }