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