Jump to content




Sign in to follow this  
Flip76

How to run WPF from WinPE Task Sequence



Recommended Posts

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?

 

Greets

 

Flip

Edited by Flip76

Share this post


Link to post
Share on other sites


hi

can you attach your smsts.log so we can see the steps and failure

Share this post


Link to post
Share on other sites

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

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.

post-35198-0-60223600-1483945615.jpg

post-35198-0-05446500-1483945627.jpg

Share this post


Link to post
Share on other sites

when you pxe boot what is the package id of the boot image?

Share this post


Link to post
Share on other sites

and is that the one you added powershell to ? you can verify via the references tab of the task sequence

Share this post


Link to post
Share on other sites

At my task sequence I've the items Show below. Cause I'd like to see if the Powershell task sequence step were executed, I've a simple task sequence of only this one step created.

post-35198-0-19303400-1483993904.jpg

post-35198-0-01473900-1483993917.jpg

Share this post


Link to post
Share on other sites

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

I got it to work now!

 

After I added some new drivers to the MDT Boot Image, I could'n redistribute it. So I decided to create a new Boot Image. At the new Boot Image I've now PowerShell support and my WPF does appear at least.

Share this post


Link to post
Share on other sites

cool, please show us a screenshot of your masterpiece and feel free to spread the love and post some sample code too :) or even a guide !

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×