Installing PowerShell with Unattended Windows CD
Here are some steps to include Windows PowerShell(for English Version of Windows XP w/ SP2) in an unattended Windows CD.
First,
I have copied Windows CD content to "C:\xpcd"
Windows PowerShell installation file,
WindowsXP-KB926139-x86-ENU.exe, has been copied over to C:\xpcd\$OEM$\$1\install\applications\- Create a batch file, install_applications.cmd (just name it to anything with .bat or .cmd extension) at C:\xpcd\$OEM$\$1\install
- Open up Winnt.sif and create a [GuiRunOnce] section and call the batch file created in the previous step.
- Simply call PowerShell installation file with silent setup switches in the batch file
Winnt.Sif:
[GuiRunOnce]
%systemdrive%\install\install_applications.cmd
install_applications.cmd:
... other application installation statements...
...
ECHO.
ECHO Installing PowerShell
ECHO Please wait...
start /wait %systemdrive%\install\applications\WindowsXP-KB926139-x86-ENU.exe /quiet /passive /norestart
exit
Yes... Now I have a Windows XP CD with Windows PowerShell.
I have installed Windows XP and saw other applications (WinZip, IrfanView, etc...) being installed.
Since PowerShell was to be installed in a silent mode, I didn't expect to see anything happening.
But 10 minutes later, PowerShell wasn't still installed.
Oh yes. I have forgotten to include .NET Framework 2.0 onto the CD...
Well, download .NET 2.0 redistributable(i have placed the installation file under
C:\xpcd\$OEM$\$1\install\applications\DotNet\2\dotnetfx.exe).
And you must include the following script
BEFORE installing PowerShell so that the result is
install_applications.cmd:
ECHO.
ECHO Installing .NET Framework 2.0
ECHO Please wait...
start /wait %systemdrive%\install\applications\DotNet\2\dotnetfx.exe /q:a /c:"install.exe /qb"
ECHO.
ECHO Installing PowerShell
ECHO Please wait...
start /wait %systemdrive%\install\applications\WindowsXP-KB926139-x86-ENU.exe /quiet /passive /norestart
Now PowerShell should install without a problem...
References:
Tags :
Monad MSH PowerShell