Set the shell execution policy:
i.The first command uses the **Set-ExecutionPolicy** cmdlet to change the execution policy to RemoteSigned.
The first command uses the **Set-ExecutionPolicy** cmdlet to change the execution policy to RemoteSigned.
ii.The second command uses the Get-ExecutionPolicy cmdlet to get the effective execution policy in the session:
The output shows that it is RemoteSigned.
iii.The third command shows what happens when you run a blocked script in a Windows PowerShell session in which the execution policy is RemoteSigned:
The RemoteSigned policy prevents you from running scripts that are downloaded from the Internet unless they are digitally signed.
iv.The fourth command uses the Unblock-File cmdlet to unblock the script so it can run in the session.Before running an **Unblock-File** command, read the script contents and verify that it is safe:
v.The fifth and sixth commands show the effect of the **Unblock-File** command:
The **Unblock-File** command does not change the execution policy. However, it unblocks the script so it will run in Windows PowerShell.This example shows the effect of the RemoteSigned execution policy, which prevents you from running unsigned scripts that were downloaded from the Internet. It also shows how to use the Unblock-File cmdlet to unblock scripts, so that you can run them without changing the execution policy.
Limited seats available! Visit JeeviAcademy or call +91 9994051212 to enroll. Start your journey towards a successful career in UI & UX design now!