Enforce running the script as admininstrator

suggest change
#requires -RunAsAdministrator

After trying to run this script without admin privileges, you will see this error message

.\script.ps1 : The script ‘script.ps1’ cannot be run because it contains a “#requires” statement for running as Administrator. The current Windows PowerShell session is not running as Administrator. Start Windows PowerShell by using the Run as Administrator option, and then try running the script again.

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents