From 88de4abcb125f17ab4329ae6c927b1e2e0bb6df3 Mon Sep 17 00:00:00 2001 From: dyoder Date: Thu, 23 Sep 2021 14:50:36 -0400 Subject: [PATCH] use Install-MBSAgent cmdlet instead of manual install --- Install-EmberkomCloudBackup.ps1 | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/Install-EmberkomCloudBackup.ps1 b/Install-EmberkomCloudBackup.ps1 index c85c6ca..1f3a3ef 100644 --- a/Install-EmberkomCloudBackup.ps1 +++ b/Install-EmberkomCloudBackup.ps1 @@ -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"""