none
PowerShell 3.0 Task Sequence install RRS feed

  • Question

  • I need to install PS 3.0 in the TS.

    Using the following command line:

    Windows6.1-KB2506143-x64.msu /quiet /norestart

    And then force reboot withj MDT

    Works fine in the command line. However failing to install with Task Sequence. I keep getting error 2, or error 193.

    Cant find what those errors are related to?

    Thanks for the help.

    Friday, August 2, 2013 2:49 PM

Answers

  • Packages only get deployed offline during a clean build deployment. You can use WSUS or Microsoft update for a Post-OS update.

    You can also use the Windows Update Standalone Installer (wusa.exe from a command prompt). This is the reason your packages works in the command line. Behind the scenes windows locates wusa.exe for you. However, in a task sequence, it tries a literal execution and fails.

    You will need to prefix your package with wusa.exe like this:

      wusa.exe C:\Packages\Powershell3\Windows6.1-KB2506143-x64.msu /quiet /norestart

    /Andrew


    Blog: http://scriptimus.wordpress.com

    • Proposed as answer by Frank TroutMVP Saturday, August 3, 2013 12:33 PM
    • Marked as answer by Ogeccut Tuesday, August 6, 2013 1:49 PM
    Saturday, August 3, 2013 11:22 AM

All replies

  • Did you import the source or are you trying to run the MSU off a network share?

    David Coulter | http://DCtheGeek.blogspot.com | @DCtheGeek

    Friday, August 2, 2013 3:03 PM
    Answerer
  • I have an application created:

    command line Windows6.1-KB2506143-x64.msu /quiet /norestart

    And working directory .\Applications and  Windows6.1-KB2506143-x64.msu in the applications folder.

    If i extract in there are two cab files, xml and a txt. Is there a way to install extracted contexts? 

    Running application without source .
    • Edited by Ogeccut Friday, August 2, 2013 3:10 PM
    Friday, August 2, 2013 3:09 PM
  • No, I didn't mean to extract the .MSU, sorry.  I wanted to validate the .MSU was local and wasn't being run from a network share (which can cause the 193 error).  What's the error in the log, can you post your bdd.log (to skydrive or something) or just email it to me?

    David Coulter | http://DCtheGeek.blogspot.com | @DCtheGeek

    Friday, August 2, 2013 3:11 PM
    Answerer
  • I will post the log.

    But if the application is run from the MDT then its not local. 

    Running from \\server\deploymentshare$\applications folder?

    I can open a cmd windows from that share and run same command line with no issues. Does MDT consider .msu different then .exe? Do i need to create a package?

    Testing it now.

    Friday, August 2, 2013 3:27 PM
  • About to run command: \\PY1CTHYPVT01\DeploymentShare$\Tools\X64\bddrun.exe Windows6.1-KB2506143-x64.msu /quiet /norestart ZTIApplications 8/2/2013 11:55:28 AM 0 (0x0000)
    Command has been started (process ID 448) ZTIApplications 8/2/2013 11:55:28 AM 0 (0x0000)
    Return code from command = 193 ZTIApplications 8/2/2013 11:55:29 AM 0 (0x0000)
    Application MS PowerShell-Imported 3.0 returned an unexpected return code: 193 ZTIApplications 8/2/2013 11:55:29 AM 0 (0x0000)
    Friday, August 2, 2013 4:05 PM
  • Created a package with an msu. Added a package to ts in the state restore. I dont think the msu has been applied. PowerShell is still at 2.0.
    Friday, August 2, 2013 4:30 PM
  • Packages only get deployed offline during a clean build deployment. You can use WSUS or Microsoft update for a Post-OS update.

    You can also use the Windows Update Standalone Installer (wusa.exe from a command prompt). This is the reason your packages works in the command line. Behind the scenes windows locates wusa.exe for you. However, in a task sequence, it tries a literal execution and fails.

    You will need to prefix your package with wusa.exe like this:

      wusa.exe C:\Packages\Powershell3\Windows6.1-KB2506143-x64.msu /quiet /norestart

    /Andrew


    Blog: http://scriptimus.wordpress.com

    • Proposed as answer by Frank TroutMVP Saturday, August 3, 2013 12:33 PM
    • Marked as answer by Ogeccut Tuesday, August 6, 2013 1:49 PM
    Saturday, August 3, 2013 11:22 AM
  • Sorry it took a while. I already had it working, but you are %100 correct. I needed to use wusa.exe.

    Thanks Andrew.

    Tuesday, August 6, 2013 1:50 PM
  • I upgrade my windows 7 to powershell 3.0 using a vb script as an application, reboot and all set. Just put the msu in the same folder. Hope this helps.

    vbs script:

    Dim objfso, objShell
    Dim folder, files, sFolder, folderidx, Iretval, return
    Set objfso = CreateObject("Scripting.FileSystemObject")
    Set objShell = CreateObject("Wscript.Shell") 
    sFolder = left(WScript.ScriptFullName,(Len(WScript.ScriptFullName))-(len(WScript.ScriptName))) 
    Set folder = objfso.GetFolder(sFolder)  
    Set files = folder.Files   
    For each folderIdx In files    
     If Ucase(Right(folderIdx.name,3)) = "MSU" then
      wscript.echo "c:\windows\system32\wusa.exe " & sfolder & folderidx.name & " /quiet /norestart"
      iretval=objShell.Run ("c:\windows\system32\wusa.exe " & sfolder & folderidx.name & " /quiet /norestart", 1, True)
       If (iRetVal = 0) or (iRetVal = 3010) then
        wscript.echo folderidx.name & " Success"
       Else 
       wscript.echo folderidx.name & " Failed"         
       wscript.quit(1)
       End If
     End If
    Next

    Tuesday, August 6, 2013 8:09 PM
  • Hi all, I'm still working with MDT 2012 Update 1 and I would like to add PowerShell 3.0 to our Windows 7 SP1 x64 image.

    However, simply adding Windows6.1-KB2506143-x64.msu to the Packages folder seems to break the deployment. Why is that? Should I use the steps mentioned above to process the package instead?

    Wednesday, December 4, 2013 8:41 AM
  • It's possible, there are a *lot* of things that can break deployments.

    If you want to add it to the packages folder and it breaks (how?), check the logs and debug the problem. But it wouldn't surprise me if it didn't work, I've seen some problems recently with highly customized unattend.xml files during the /Apply-Unattended phase during OS installation.

    Otherwise the script solution above works, another solution would be to add Windows6.1-KB2506143-x64.msu as an application with the command line (assumes you understand how to import apps with correct paths in MDT) :

    WUSA.EXE .\Windows6.1-KB2506143-x64.msu /quiet /norestart


    Keith Garner - keithga.wordpress.com

    Wednesday, December 4, 2013 8:55 PM
    Moderator
  • Thanks for the reply. There is actually very little customization going on, I had previously updated the task sequence using Johan Ardwidmark's post on how to incorporate IE10/IE11 in the default Windows image (link below). That requires you to add a number of OS packages, none of which broke deployment. But adding KB2506143 did, I will retry that scenario and dig out the logs.

    If that doesn't work, adding msu as an application is a very nice alternative. Thanks again!

    http://www.deploymentresearch.com/Research/tabid/62/EntryId/124/Adding-Internet-Explorer-11-to-your-Windows-7-SP1-reference-image.aspx

    Monday, December 9, 2013 3:04 PM