Forum Discussion

  • MB_Smith's avatar
    MB_Smith
    Iron Contributor

    You really shouldn't change the ExecutionPolicy at the end of the script. Executing PowerShell with the "-ExecutionPolicy Bypass" does NOT update the registry value for ExecutionPolicy.

     

    Also, you should look for specific displaynames that you are keeping. "*store*" is overly generic. 'Microsoft.StorePurchaseApp' and 'Microsoft.WindowsStore' are the two displaynames that need to be retained.

     

    Lastly, I think you should have a "noGUI" option so that this could be used in a scheduled task or in a deployment sequence.

Resources