Quick way to set the powershell ExecutionPolicy for the session
On my workstation I’ve set the powershelle executionpolicy to unrestricted. But there are times I need to run a script directly from a server and I don’t want to change the policy just run this script this one time.
set-executionpolicy can be applied at different levels:
-Scope ExecutionPolicyScope The scope of the execution policy. Valid values: Process Affect only the current PowerShell process. CurrentUser Affect only the current user. LocalMachine Affect all users of the computer.
If you use -scope process it will just change the policy for the existing session.
Its quick and easy, hope this help you in your powershell journey.
Have any other quick powershell tips, leave them in the comments below.
More Stories
Security URL scanners
As the internet continues to evolve, so do the threats that come with it. One of the most common threats...
Security tools bookmarks
As I'm learning about different security tools and solutions, I keep adding to my bookmarks for follow-up. Today, I'm sharing...
Collection of build numbers
I feel like I'm always looking for an applications history of builds. Sometimes its for windows 10 others for different...
Running office365 on non-persistent VDI desktops
We are working on building our our win10 image with o365 and onedrive. I'm capturing a few links I found...
how to delegate rights to manage printers
Here are some helpful post on setting up delegation on print servers, this includes some powershell scripts to help.
How to configure powershell for o365
Everytime you get a new computer you have to download the latest powershell modules for o365 and it seems like...