provisioner/windows-restart: Get full hostname, instead of just the NetBIOS name. (#9335)
`env:COMPUTERNAME` give you the first 15 characters of the machine name (the NetBIOS name). But normally its pretty nice to get the full DNS name. We can solve this in this way.
This commit is contained in:
parent
e0cfb404fb
commit
19e4afa728
|
@ -23,7 +23,7 @@ import (
|
|||
)
|
||||
|
||||
var DefaultRestartCommand = `shutdown /r /f /t 0 /c "packer restart"`
|
||||
var DefaultRestartCheckCommand = winrm.Powershell(`echo "${env:COMPUTERNAME} restarted."`)
|
||||
var DefaultRestartCheckCommand = winrm.Powershell(`echo ("{0} restarted." -f [System.Net.Dns]::GetHostName())`)
|
||||
var retryableSleep = 5 * time.Second
|
||||
var TryCheckReboot = `shutdown /r /f /t 60 /c "packer restart test"`
|
||||
var AbortReboot = `shutdown /a`
|
||||
|
|
Loading…
Reference in New Issue