Adding execution bypass to existing script

Rick Someone 411 Reputation points
2020-12-02T20:38:57.093+00:00

I see that most posts use examples of executionpolicy unrestricted -force and then point to a ps.1

I have a PowerShell script I want to run but I'm wondering if I can put the bypass right in the script I'm trying to run. Such as:

  1. set-executionpolicy unrestricted -force
  2. Get-appx...blah blah.....

I am wishing not to have one script invoke another, but have it all in one script. Or how would I add this to a batch file if needed?

Microsoft Deployment Toolkit
Microsoft Deployment Toolkit
A collection of Microsoft tools and documentation for automating desktop and server deployment. Previously known as Microsoft Solution Accelerator for Business Desktop Deployment (BDD).
859 questions
0 comments No comments
{count} votes

0 additional answers

Sort by: Most helpful