From the course: Learning PowerShell for Windows Server Administration

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Managing execution policies

Managing execution policies

From the course: Learning PowerShell for Windows Server Administration

Start my 1-month free trial

Managing execution policies

- [Instructor] The next thing that we want to do in PowerShell is take the steps necessary to make our customer aliases and functions persistent. And that requires creating a special script. But before we can do that, we need to make sure that our system will run scripts. PowerShell is growing in popularity including with those who might want to do us harm. Malicious PowerShell scripts are on the rise. So there are execution policies that limit what scripts get run on our machine. If we want to see what the execution policy is, we would use the cmdlet Get-ExecutionPolicy. Once again, these cmdlets have no spaces in them and I'm capitalizing each word to make it easier to read and troubleshoot cmdlets. When I run Get-ExecutionPolicy, I am going to add another parameter of List. This allows me to see all of the executions policies that are being applied at this time. And I can see that most of these policies are not defined, but anything running on the local machine must be remotely…

Contents