update
This commit is contained in:
@@ -569,19 +569,15 @@ Function Disable-Log {
|
||||
}
|
||||
|
||||
# Function to install the MSP360 Powershell module
|
||||
Function Install-MSP360Module {
|
||||
Function Import-MSP360Module {
|
||||
Try {
|
||||
$module = Get-Module -ListAvailable -Name MSP360
|
||||
If ( (-not $module) -and (IsAdmin) ) {
|
||||
Write-Output "Installing MSP360 Powershell module"
|
||||
Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Scope Process
|
||||
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
|
||||
Invoke-Expression (New-Object System.Net.WebClient).DownloadString('https://git.io/JUSAA')
|
||||
Install-MSP360Module
|
||||
}
|
||||
ElseIf ( (-not $module) -and (-not (IsAdmin)) ) {
|
||||
Write-Output "The MSP360 Powershell module needs to be installed, but the current security context is not sufficient to install it"
|
||||
}
|
||||
If ( -not (IsAdmin) ) { Write-Output "The MSP360 Powershell module needs to be installed, but the current account is not an administrative user" ; Return }
|
||||
Write-Output "Installing MSP360 Powershell module"
|
||||
Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Scope Process
|
||||
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
|
||||
Invoke-Expression (New-Object System.Net.WebClient).DownloadString('https://git.io/JUSAA')
|
||||
Install-MSP360Module
|
||||
Import-Module -Name MSP360
|
||||
}
|
||||
Catch { Write-Error $_.Exception.Message }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user