Powershell Script failing

Ed7 96 Reputation points
2021-09-03T13:30:36.477+00:00

Hello,

I am trying to run a powershell script in MDT, however it is always failing. This script is to remove some defaults windows apps,.
Could someone help me please?

129153-image.png

Windows for business Windows Client for IT Pros Devices and deployment Set up, install, or upgrade
Microsoft 365 and Office Development Office JavaScript API
Windows for business Windows Server User experience PowerShell
Windows for business Windows Server User experience Other
Developer technologies .NET Other
{count} votes

6 answers

Sort by: Most helpful
  1. MotoX80 36,291 Reputation points
    2021-09-07T11:46:03.01+00:00

    Assuming that cmd.exe will run, capture stdout and stderr to see if there is some error in there.

    cmd.exe /c powershell.exe -executionpolicy bypass -file "%SCRIPTROOT%\Windows_Cust.ps1" 1 > C:\YourLogFolder\MyScript.log 2>&1
    

    Also add a transcript into your .ps1 code.

    https://www.tutorialspoint.com/how-to-use-a-transcript-in-powershell

    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.