Jump to content

Will this script work? (Command Prompt)

Redportal

Hi Everyone,

Just wondering if someone could let me know if this script will work or not.

powershell -ExecutionPolicy ByPass -File 2.ps1

The "2.ps1" is the name of my power shell script, using the above code I want to execute the power shell script from within command prompt.

 

The reason for behind this, is that I need to run a power shell script along with multiple other command prompt commands. The "ByPass" is to, well simply bypass the power shell execution policy.(Which is set to restricted by default)

I could of course manually restrict and unrestricted the power shell execution policy, however I plan to run this on more than 100+ machines. Which means the more automation the better. xD

 

Many thanks in advance.

Connor Freebairn - ConnorFreebairn@newman.cumbria.sch.uk
IT Technician & Certified computer geek.

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×