Quantcast
Viewing all articles
Browse latest Browse all 21975

Calling powershell script from a batch file

Hello All,

I have a batch script that calls a powershell script. Before calling the script I set the execution policy to unrestricted, but when it gets to the line that calls the batch script i still get the confirmation in the command window: "Do you want to perform this operation" I then have to press Y for the PS script to run and then my batch script finishes.

Does anyone know the setting I need to change in order to suppress the confirmation?

Note: this is Windows 8, see code below





set THIS_DIR=%~dp0

powershell Set-ExecutionPolicy unrestricted 

powershell %THIS_DIR%MyScript.ps1 "param1"




Viewing all articles
Browse latest Browse all 21975

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>