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).
892 questions
0 comments No comments
{count} votes

Accepted answer
  1. Rick Someone 411 Reputation points
    2020-12-10T20:15:24.617+00:00

    I ended up making two bat files in the same folder.
    One stops the service and one starts. Simple enough.

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.