move powershell module installs to Tools.ps1
update Install-EmberkomCloudBackup.ps1
This commit is contained in:
@@ -15,10 +15,11 @@ switch ( $Edition.ToLower() ) {
|
||||
default { $URL = $ECB_WIN_URL; $AgentEdition = 'desktop' }
|
||||
}
|
||||
|
||||
## Install and import the MSP360 Powershell module
|
||||
Run-Script -LivePSScript Install-MSP360PowershellModule
|
||||
LogMsg "Importing MSP360 Powershell module"
|
||||
## Install and import additional Powershell modules
|
||||
Install-MSP360Module
|
||||
Import-Module -Name MSP360
|
||||
Install-PSAteraModule
|
||||
Import-Module -Name PSAtera
|
||||
|
||||
## Install the agent
|
||||
$INSTALLER = Download-File -URL $URL
|
||||
@@ -36,15 +37,10 @@ LogMsg "Setting Emberkom Cloud Backup agent edition to ""$AgentEdition"""
|
||||
Try { Set-MBSAgentSetting -Edition $AgentEdition }
|
||||
Catch { $_.Exception.Message }
|
||||
|
||||
## Install and import the PSAtera Powershell Module
|
||||
Run-Script -LivePSScript Install-PSAteraModule
|
||||
LogMsg "Importing PSAtera Powershell module"
|
||||
Import-Module -Name PSAtera
|
||||
Set-AteraAPIKey = $AteraAPIKey
|
||||
|
||||
## Get agent details and custom fields from Atera
|
||||
Try {
|
||||
LogMsg "Getting Atera agent and custom field information"
|
||||
Set-AteraAPIKey = $AteraAPIKey
|
||||
$AteraAgent = Get-AteraAgent
|
||||
$MSP360Username = Get-AteraCustomValue -ObjectType Customer -ObjectId $AteraAgent.CustomerID -FieldName 'MSP360 Account Username'
|
||||
$MSP360Password = Get-AteraCustomValue -ObjectType Customer -ObjectId $AteraAgent.CustomerID -FieldName 'MSP360 Account Password'
|
||||
|
||||
Reference in New Issue
Block a user