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:
Søren Hansen 2020-06-02 19:45:02 +02:00 committed by GitHub
parent e0cfb404fb
commit 19e4afa728
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -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`