Fix dumbass mistake in autounattend-postinstall.ps1

jowjDev
Micah R Ledbetter 7 years ago
parent 77015797cf
commit 840870a600

@ -21,23 +21,24 @@ Invoke-ScriptblockAndCatch -scriptBlock {
# Note that we need to reboot for some of these drivers to take
# AHHHH, PACKER_BUILDER_TYPE ISN'T AVAILABLE HERE BECAUSE IT'S INVOKED FROM THE WINDOWS INSTALLER. Hmmmmmm. Might have to do this later.
if ($env:PACKER_BUILDER_TYPE -contains "virtualbox") {
# Requires that the packerfile attach the Guest VM driver disk, rather than upload it (the packer-windows way). Uploading it gives problems with WinRM for some reason.
Install-VBoxAdditions -fromDisc
}
elseif ($env:PACKER_BUILDER_TYPE -contains "hyperv") {
Write-EventLogWrapper -message "Hyper-V builder detected, but we don't have a way to install its drivers yet"
}
else {
Write-EventLogWrapper -message "A builder called '$env:PACKER_BUILDER_TYPE' was detected, but we don't have a way to install its drivers yet"
}
# if ($env:PACKER_BUILDER_TYPE -contains "virtualbox") {
# # Requires that the packerfile attach the Guest VM driver disk, rather than upload it (the packer-windows way). Uploading it gives problems with WinRM for some reason.
# Install-VBoxAdditions -fromDisc
# }
# elseif ($env:PACKER_BUILDER_TYPE -contains "hyperv") {
# Write-EventLogWrapper -message "Hyper-V builder detected, but we don't have a way to install its drivers yet"
# }
# else {
# Write-EventLogWrapper -message "A builder called '$env:PACKER_BUILDER_TYPE' was detected, but we don't have a way to install its drivers yet"
# }
Install-VBoxAdditions -fromDisc
# Required for Windows 10, not required for 81, not sure about other OSes
# Should probably happen after installing Guest VM drivers, in case installing the drivers would cause Windows to see the network as a new connection
Set-AllNetworksToPrivate
if ($SkipWindowsUpdates) {
$restartCommand = [ScriptBlock]::Create("A:\enable-winrm.ps1") }
$restartCommand = [ScriptBlock]::Create("A:\enable-winrm.ps1")
}
else {
$restartCommand = [ScriptBlock]::Create("A:\win-updates.ps1 -PostUpdateExpression A:\enable-winrm.ps1")

Loading…
Cancel
Save