KACE Product Support Question

Script that runs in win-7 wont run in win-10

10/19/2017 608 views

Hi Guys.

I have a powershell scriptthat runs fine in my win-7 image deployment.  The script updates windows from our wsus server

after a domain join.

I am now creating a new image with win-10....(the latest creators update..1709) and the script wont run.

Says something about execution policy.

Any help would be great.

2 Comments   [ + ] Show comments


  • Not to be rude, but did you do a Google search for "powershell execution policy"?
  • What I meant to say chuck..... is that my "Windows updates" powershell script.... that worked in win7... doesn't seem to work in win10.
    I believe you pointed me in the right direction last year to getting a post install task for wsus updates for my win7 image.........
    The point is that the "powershell.exe -executionPolicy bypass " is part of the old script.
    So I shouldn't be getting execution-policy issues.
    Just wanted to know if something has changed in win10.
    FYI...I have enabled execution policy and then run the PS script...but still fails.

All Answers

You need to call the script with the proper execution policy. That cannot be within the ps1 file itself... when you call the ps1 you have to already have bypassed it.

powershell.exe --ExecutionPolicy Bypass -File myscript.ps1
Answered 10/19/2017 by: airwolf
Red Belt

  • I have done that. I have the bat file and the Ps1 all zipped into a zip file. The bat call the ps1 after executing the policy.. like this.......(without quotes)..
    "powershell.exe -executionPolicy bypass -file windowsupdates.ps1 -UpdateTypes All".

    Like I said it is the same file being run as a post install task in win7, in and works perfectly till date.
    Win7 also disables script execution-policy by default and need to be enabled.
    Any other update script I can try?

Don't be a Stranger!

Sign up today to participate, stay informed, earn points and establish a reputation for yourself!

Sign up! or login


This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ