use Install-MBSAgent cmdlet instead of manual install

This commit is contained in:
2021-09-23 14:50:36 -04:00
parent d5b870bc48
commit 88de4abcb1
+9 -7
View File
@@ -22,15 +22,17 @@ Install-PSAteraModule
Import-Module -Name PSAtera
## Install the agent
$INSTALLER = Download-File -URL $URL
#$INSTALLER = Download-File -URL $URL
LogMsg "Installing Emberkom Cloud Backup agent"
Try { Start-Process $INSTALLER -ArgumentList "/S" -Wait }
Try { Install-MBSAgent -URL $URL -Force }
Catch { LogErr $_.Exception.Message }
If ( Test-Path $INSTALLER ) {
LogMsg "Deleting Emberkom Cloud Backup agent installer: ""${INSTALLER}"""
Try { Remove-Item $INSTALLER -Force }
Catch { LogErr $_.Exception.Message }
}
#Try { Start-Process $INSTALLER -ArgumentList "/S" -Wait }
#Catch { LogErr $_.Exception.Message }
#If ( Test-Path $INSTALLER ) {
# LogMsg "Deleting Emberkom Cloud Backup agent installer: ""${INSTALLER}"""
# Try { Remove-Item $INSTALLER -Force }
# Catch { LogErr $_.Exception.Message }
#}
## Set the agent edition
LogMsg "Setting Emberkom Cloud Backup agent edition to ""$AgentEdition"""