SCCM task run powershell script fails with not found in X:

Daniel Kaliel 1,266 Reputation points
2023-02-07T16:59:08.3366667+00:00

I have a few powershell scripts set to run near the end of the sequence but they fail with the message below. That makes me think it is trying to use WinPE to run powershell instead of the local install of the OS. I've also included a screenshot of where it is in the sequence. How to I get it to not use the WinPE environment?

PowerShell.exe does not exist at 'X:\windows\system32\windowspowershell\v1.0\powershell.exe'

Run PowerShell script failed to run, hr=0x80070490. The operating system reported error 2147943568: Element not found.

Screenshot 2023-02-07 095829

Microsoft Configuration Manager Deployment
Microsoft Configuration Manager Deployment
Microsoft Configuration Manager: An integrated solution for for managing large groups of personal computers and servers.Deployment: The process of delivering, assembling, and maintaining a particular version of a software system at a site.
999 questions
Microsoft Configuration Manager
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. CherryZhang-MSFT 6,491 Reputation points
    2023-02-08T07:23:38.01+00:00

    Hi @Daniel Kaliel

    Please press F8 when the task sequence execution fails to check if it boots to Windows PE. If so, please help check the steps above for running PowerShell script, it may be due to any steps booted it into Windows PE.

    This similar threader for your reference:

    https://learn.microsoft.com/en-us/answers/questions/988624/run-powershell-script-in-windows-11-ts-doesnt-work?sort=oldest

    Looking forward to your feedback.

    Best regards

    Cherry


     

    If the response is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


  2. Toivola Mikko 6 Reputation points
    2024-11-08T07:51:39.0533333+00:00

    Just ran into similar issue, with same error numbers. Our problem was new boot image that didn't have the powershell optional component. So I added it like in the picture below and it's working fine now. User's image

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.