As you progress with your PowerShell skills you will find it necessary to understand the execution policies & permissions for PowerShell.
At this stage, I am dealing with issues as they arise. The commands I am using to adjust permissions are as follows:
Get-ExecutionPolicy
The starting point is to investigate the current execution policy settings.
Get-ExecutionPolicy -List
Set-ExecutionPolicy
The commands for setting the execution policy is equally as intuitive:
Set-ExecutionPolicy remotesigned
Set-ExecutionPolicy unrestricted
Resources:
- https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.security/get-executionpolicy?view=powershell-7.1
- https://superuser.com/questions/106360/how-to-enable-execution-of-powershell-scripts
- https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_signing?view=powershell-7.1
- https://docs.microsoft.com/en-gb/powershell/module/microsoft.powershell.core/about/about_execution_policies?view=powershell-7.1