use master password to change agent settings

This commit is contained in:
2024-01-29 11:58:20 -05:00
parent 41b7174628
commit ec6a9a96ec
+6 -1
View File
@@ -39,7 +39,12 @@ Start-Sleep -Seconds 10
# Set the agent edition
# Note: the product edition must be set *after* the user is added
Write-Output "Setting Emberkom Cloud Backup agent edition to ""$AgentEdition"""
Try { Set-MBSAgentSetting -Edition $AgentEdition -Verbose }
Try {
Switch ([string]::IsNullOrEmpty($MasterPassword)) {
$true { Set-MBSAgentSetting -Edition $AgentEdition -Verbose }
$false { Set-MBSAgentSetting -Edition $AgentEdition -MasterPassword (ConvertTo-SecureString -String $MasterPassword -AsPlainText -Force) -Verbose }
}
}
Catch { Write-Error $_.Exception.Message }
# Delete the desktop icon