Commit 42aa34e0 authored by Stefan Scherer's avatar Stefan Scherer

install Hotfix KB2552055 to fix PowerShell 2.0 exitcode

parent 4b2b07cd
......@@ -232,6 +232,11 @@
<Description>Disable password expiration for vagrant user</Description>
</SynchronousCommand>
<!-- WITHOUT WINDOWS UPDATES -->
<SynchronousCommand wcm:action="add">
<CommandLine>cmd.exe /c a:\hotfix-KB2552055.bat</CommandLine>
<Order>98</Order>
<Description>Fix for PowerShell 2.0 to return correct exitcode</Description>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<CommandLine>cmd.exe /c C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -File a:\openssh.ps1 -AutoStart</CommandLine>
<Description>Install OpenSSH</Description>
......
......@@ -268,6 +268,11 @@
<Description>Disable password expiration for vagrant user</Description>
</SynchronousCommand>
<!-- WITHOUT WINDOWS UPDATES -->
<SynchronousCommand wcm:action="add">
<CommandLine>cmd.exe /c a:\hotfix-KB2552055.bat</CommandLine>
<Order>98</Order>
<Description>Fix for PowerShell 2.0 to return correct exitcode</Description>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<CommandLine>cmd.exe /c C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -File a:\openssh.ps1 -AutoStart</CommandLine>
<Description>Install OpenSSH</Description>
......
......@@ -233,6 +233,11 @@
<Description>Disable password expiration for vagrant user</Description>
</SynchronousCommand>
<!-- WITHOUT WINDOWS UPDATES -->
<SynchronousCommand wcm:action="add">
<CommandLine>cmd.exe /c a:\hotfix-KB2552055.bat</CommandLine>
<Description>Fix for PowerShell 2.0 to return correct exitcode</Description>
<Order>98</Order>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<CommandLine>cmd.exe /c C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -File a:\openssh.ps1 -AutoStart</CommandLine>
<Description>Install OpenSSH</Description>
......
@echo off
:: Windows 7 / Windows 2008 R2 require KB2552055 hotfix
:: This fixes a problem with wrong exitcode 0 instead of custom exitcode in PowerShell 2.0
setlocal
if defined ProgramFiles(x86) (
set link=http://hotfixv4.microsoft.com/Windows%%207/Windows%%20Server2008%%20R2%%20SP1/sp2/Fix373932/7600/free/438167_intl_x64_zip.exe
set msufilename=%TEMP%\Windows6.1-KB2552055-x64.msu
) else (
set link=http://hotfixv4.microsoft.com/Windows%%207/Windows%%20Server2008%%20R2%%20SP1/sp2/Fix373932/7600/free/438164_intl_i386_zip.exe
set msufilename=%TEMP%\Windows6.1-KB2552055-x86.msu
)
set zipfilename=%TEMP%\KB2552055.zip
echo Downloading Hotfix 2552055
powershell -Command "(New-Object System.Net.WebClient).DownloadFile('%link%', '%zipfilename%')" <NUL
echo Extracting Hotfix 2552055
powershell -Command "(New-Object -com Shell.Application).NameSpace('%TEMP%').CopyHere((New-Object -Com Shell.Application).NameSpace('%zipfilename%').items())" <NUL
echo Installing Hotfix 2552055
wusa %msufilename% /quiet /norestart
echo Cleanup Hotfix temp files
del /Q %msufilename%
del /Q %zipfilename%
......@@ -18,6 +18,7 @@
"vnc_port_max": 5980,
"floppy_files": [
"./answer_files/2008_r2/Autounattend.xml",
"./scripts/hotfix-KB2552055.bat",
"./scripts/microsoft-updates.bat",
"./scripts/win-updates.ps1",
"./scripts/openssh.ps1"
......@@ -45,6 +46,7 @@
"disk_size": 61440,
"floppy_files": [
"./answer_files/2008_r2/Autounattend.xml",
"./scripts/hotfix-KB2552055.bat",
"./scripts/microsoft-updates.bat",
"./scripts/win-updates.ps1",
"./scripts/openssh.ps1",
......
......@@ -17,6 +17,7 @@
"vnc_port_max": 5980,
"floppy_files": [
"./answer_files/2008_r2_core/Autounattend.xml",
"./scripts/hotfix-KB2552055.bat",
"./scripts/win-updates.ps1",
"./scripts/openssh.ps1"
],
......@@ -42,6 +43,7 @@
"disk_size": 61440,
"floppy_files": [
"./answer_files/2008_r2_core/Autounattend.xml",
"./scripts/hotfix-KB2552055.bat",
"./scripts/win-updates.ps1",
"./scripts/openssh.ps1",
"./scripts/oracle-cert.cer"
......
......@@ -18,6 +18,7 @@
"vnc_port_max": 5980,
"floppy_files": [
"./answer_files/7/Autounattend.xml",
"./scripts/hotfix-KB2552055.bat",
"./scripts/microsoft-updates.bat",
"./scripts/win-updates.ps1",
"./scripts/openssh.ps1"
......@@ -45,6 +46,7 @@
"disk_size": 61440,
"floppy_files": [
"./answer_files/7/Autounattend.xml",
"./scripts/hotfix-KB2552055.bat",
"./scripts/microsoft-updates.bat",
"./scripts/win-updates.ps1",
"./scripts/openssh.ps1",
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment