Summary: Learn how to require admin privileges to run a Windows PowerShell script.
How can I make sure that my Windows PowerShell script has administrator privileges to run?
Use the #Requires directive and specify RunAsAdministrator. Here is an example:
#Requires -RunAsAdministrator
0 comments