Would you like to learn how to verify if your command-line has Administrator rights using Powershell? In this tutorial, we are going to show you how to check if your Powershell command-line or Script has Administrator rights on a computer running Windows.

• Windows 2012 R2
• Windows 2016
• Windows 2019
• Windows 10
• Windows 7

Equipment list

The following section presents the list of equipment used to create this tutorial.

As an Amazon Associate, I earn from qualifying purchases.

Related tutorial - PowerShell

On this page, we offer quick access to a list of tutorials related to PowerShell.

Tutorial Powershell - Check if the command-line is running as Administrator

Start a Powershell command-line.

Start Powershell

Verify if the command-line has Administrator rights.

Copy to Clipboard

Here is the command output.

Copy to Clipboard

As an Administrator, start a new POWERSHELL command-line prompt.

Windows 10 - powershell elevated

Verify if the command-line has Administrator rights.

Copy to Clipboard

Here is the command output.

Copy to Clipboard

Optionally, you can use the IF statement to provide better feedback.

Copy to Clipboard

Congratulations! You are able to verify it the Powershell command line is running as Administrator.