Merge "fixed VM initialization script" into conductor-openstack-style
This commit is contained in:
@@ -9,7 +9,6 @@ $RestartRequired = $false
|
||||
|
||||
Import-Module CoreFunctions
|
||||
|
||||
if ( $WindowsAgentConfigBase64 -ne '%WINDOWS_AGENT_CONFIG_BASE64%' ) {
|
||||
Write-Log "Updating Keero Windows Agent."
|
||||
Stop-Service "Keero Agent"
|
||||
Backup-File $WindowsAgentConfigFile
|
||||
@@ -17,14 +16,12 @@ if ( $WindowsAgentConfigBase64 -ne '%WINDOWS_AGENT_CONFIG_BASE64%' ) {
|
||||
ConvertFrom-Base64String -Base64String $WindowsAgentConfigBase64 -Path $WindowsAgentConfigFile
|
||||
Exec sc.exe 'config','"Keero Agent"','start=','delayed-auto'
|
||||
Write-Log "Service has been updated."
|
||||
}
|
||||
|
||||
if ( $NewComputerName -ne '%INTERNAL_HOSTNAME%' ) {
|
||||
Write-Log "Renaming computer ..."
|
||||
Rename-Computer -NewName $NewComputerName | Out-Null
|
||||
Write-Log "New name assigned, restart required."
|
||||
$RestartRequired = $true
|
||||
}
|
||||
|
||||
|
||||
Write-Log 'All done!'
|
||||
if ( $RestartRequired ) {
|
||||
|
Reference in New Issue
Block a user