install using ps job

This commit is contained in:
2022-12-15 14:03:05 -05:00
parent 1c5d7e26d6
commit 1cc289c119
+6 -1
View File
@@ -21,7 +21,12 @@ Import-Module -Name MSP360
# Install the agent
LogMsg "Installing Emberkom Cloud Backup agent"
Try { Install-MBSAgent -URL $URL -Force -Wait }
Try {
$JobName = "MSP360AgentInstall"
Start-Job -Name $JobName -Scriptblock { Install-MBSAgent -URL $URL -Force }
Wait-Job -Name $JobName
Remove-Job -Name $JobName -Force
}
Catch { LogErr $_.Exception.Message }
# Add backup user to installed product