Jump to content

  • 0

How to run WPF from WinPE Task Sequence


Update: Looks like PowerShell ist missing on the X:-Volume. I've only an empty folder X:\Windows\System32\WindowsPowerShell\v1.0. I updated the WIM again. Nothing happens!


Good evening!


I'm using SCCM Current Branch with MDT 2013 Update 2. I want to create a universal OS deployment task sequence with an WPF GUI.


I've done the following steps:

- Creating a simple WPF with Visual Basic 2015

- Implemented the XAML-Code into a PowerShell script (Show-OSConfigurator.ps1). The PowerShell script standalone starts without any errors.

- Implemented an redistributed my MDT Boot Image (only x64 in use) with the necessary optional components (NetFx, PowerShell)

- Creating a package (Show OS-Configurator) with the source files, without a program, and distributed it

- For testing I've created a new task sequence with only one step "Run PowerShell Script". I've referenced to the package (Show OS-Configurator) and have putted in the script Name (Show-OSConfigurator.ps1). The ExecutionPolicy is set to "ByPass".

- The task sequence is deployed to the "Unknown Devices" collection


If I run the task sequence I get an error 0x80004005.


I've tried serveral thinks from the web (HTA, VBS...) Nothing works!


Does somebody have a solution?





Edited by Flip76

Share this post

Link to post
Share on other sites

Recommended Posts

  • 0

here's your first problem, and it will block you from getting any of this to work...

<![LOG[PowerShell is not installed]LOG]!><time="19:34:07.669-60" date="01-08-2017" component="RunPowerShellScript" context="" type="3" thread="1228" file="main.cpp:151">
<![LOG[ExecutePowerShellScript(sScriptName, sParameters, sPackageID, sExecutionPolicy, dwPSRunExitCode), HRESULT=80004005 (e:\nts_sccm_release\sms\client\osdeployment\runpsscript\main.cpp,356)]LOG]!><time="19:34:07.669-60" date="01-08-2017" component="RunPowerShellScript" context="" type="0" thread="1228" file="main.cpp:356">
<![LOG[Run powershell script failed to run, hr=0x80004005]LOG]!><time="19:34:07.669-60" date="01-08-2017" component="RunPowerShellScript" context="" type="3" thread="1228" file="main.cpp:356">
<![LOG[Process completed with exit code 2147500037]LOG]!><time="19:34:07.684-60" date="01-08-2017" component="TSManager" context="" type="1" thread="1140" file="commandline.cpp:1124">
<![LOG[!--------------------------------------------------------------------------------------------!]LOG]!><time="19:34:07.684-60" date="01-08-2017" component="TSManager" context="" type="1" thread="1140" file="instruction.cxx:805">
<![LOG[Failed to run the action: Run PowerShell Script.
Unspecified error

are you sure you've added PowerShell to the correct boot image and that you've distributed that boot wim to your distribution points ?

Share this post

Link to post
Share on other sites

  • 0

Yes, I've. For sure I've attached the screenshots of the properties Windows.


Edit: I've readded the two optional components. If I add the WinPE-PowerShell component, I get a message that the component Microsoft.NET (WinPE-NetFx4) is required, but I don't have this component for selection. In some articles I've read that this components included in the Microsoft.NET (WinPE-NetFx) component.



Share this post

Link to post
Share on other sites

  • 0

I've now tested it with the default Boot Image x64. After integrating the required PowerShell components and redistributing the image, I've PowerShell support at my task sequence. Now I get an error 0x80070002, cause the PowerShell package could not be found. At the disk there is an empty package Folder.


Any further idea, how to get the PowerShell run at the MDT Boot Image?

Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.