• Skip to primary navigation
  • Skip to main content
  • Skip to footer

Stephanos Constantinou Blog

PowerShell Scripting

  • Home
  • Blogs
    • PowerShell Tutorials
    • PowerShell Scripts
    • PowerShell Modules
      • Modules Cmdlets
    • Software Reviews
  • About
  • Contact
You are here: Home / PowerShell Tutorials / PowerShell Commands Structure

PowerShell Commands Structure

30/04/2018 by Stephanos Leave a Comment

PowerShell Commands Structure

As in every command line interface you have to know the commands and the difficult part is to remember them. In this tutorial we will see a few things regarding PowerShell commands structure that will help you out to have a better understanding and may help you to memorize commands easier. PowerShell uses cmdlets, which follow one simple rule Verb-Noun -Parameter.

Verb

Every single command will start with the Verb which indicates the action that we want to perform. The most common verbs, in my opinion, are Get and Set. Each Verb is easily recognizable and memorable to help you remember or find out the cmdlet that you need to use. You are able to get the full list of PowerShell’s approved verbs using the following command:

PS C:\Users\Stephanos> Get-Verb
Verb        Group         
----        -----         
Add         Common        
Clear       Common        
Close       Common        
Copy        Common        
Enter       Common        
Exit        Common        
Find        Common        
Format      Common        
Get         Common        
Hide        Common        
Join        Common        
Lock        Common        
Move        Common        
New         Common        
Open        Common        
Optimize    Common        
Pop         Common        
Push        Common        
Redo        Common        
Remove      Common        
Rename      Common        
Reset       Common        
Resize      Common        
Search      Common        
Select      Common        
Set         Common        
Show        Common        
Skip        Common        
Split       Common        
Step        Common        
Switch      Common        
Undo        Common        
Unlock      Common        
Watch       Common        
Backup      Data          
Checkpoint  Data          
Compare     Data          
Compress    Data          
Convert     Data          
ConvertFrom Data          
ConvertTo   Data          
Dismount    Data          
Edit        Data          
Expand      Data          
Export      Data          
Group       Data          
Import      Data          
Initialize  Data          
Limit       Data          
Merge       Data          
Mount       Data          
Out         Data          
Publish     Data          
Restore     Data          
Save        Data          
Sync        Data          
Unpublish   Data          
Update      Data          
Approve     Lifecycle     
Assert      Lifecycle     
Complete    Lifecycle     
Confirm     Lifecycle     
Deny        Lifecycle     
Disable     Lifecycle     
Enable      Lifecycle     
Install     Lifecycle     
Invoke      Lifecycle     
Register    Lifecycle     
Request     Lifecycle     
Restart     Lifecycle     
Resume      Lifecycle     
Start       Lifecycle     
Stop        Lifecycle     
Submit      Lifecycle     
Suspend     Lifecycle     
Uninstall   Lifecycle     
Unregister  Lifecycle     
Wait        Lifecycle     
Debug       Diagnostic    
Measure     Diagnostic    
Ping        Diagnostic    
Repair      Diagnostic    
Resolve     Diagnostic    
Test        Diagnostic    
Trace       Diagnostic    
Connect     Communications
Disconnect  Communications
Read        Communications
Receive     Communications
Send        Communications
Write       Communications
Block       Security      
Grant       Security      
Protect     Security      
Revoke      Security      
Unblock     Security      
Unprotect   Security      
Use         Other

As you can see above, Get-Verb gives you a list of all verbs and the group that it belongs to.

Noun

The verb then is followed by a dash (-) and a Noun. The noun is the object or object type that you want to perform the action. Lets take two different objects and find out any cmdlets that they are related to these two. We will look at the Process and Service cmdlets.

PS C:\Users\Stephanos> Get-Command -Noun Service
CommandType     Name                                               Version    Source                                                                                                                                  
-----------     ----                                               -------    ------                                                                                                                                  
Cmdlet          Get-Service                                        3.1.0.0    Microsoft.PowerShell.Management                                                                                                         
Cmdlet          New-Service                                        3.1.0.0    Microsoft.PowerShell.Management                                                                                                         
Cmdlet          Restart-Service                                    3.1.0.0    Microsoft.PowerShell.Management                                                                                                         
Cmdlet          Resume-Service                                     3.1.0.0    Microsoft.PowerShell.Management                                                                                                         
Cmdlet          Set-Service                                        3.1.0.0    Microsoft.PowerShell.Management                                                                                                         
Cmdlet          Start-Service                                      3.1.0.0    Microsoft.PowerShell.Management                                                                                                         
Cmdlet          Stop-Service                                       3.1.0.0    Microsoft.PowerShell.Management                                                                                                         
Cmdlet          Suspend-Service                                    3.1.0.0    Microsoft.PowerShell.Management
PS C:\Users\Stephanos> Get-Command -Noun Process
CommandType     Name                                               Version    Source                                                                                                                                  
-----------     ----                                               -------    ------                                                                                                                                  
Cmdlet          Debug-Process                                      3.1.0.0    Microsoft.PowerShell.Management                                                                                                         
Cmdlet          Get-Process                                        3.1.0.0    Microsoft.PowerShell.Management                                                                                                         
Cmdlet          Start-Process                                      3.1.0.0    Microsoft.PowerShell.Management                                                                                                         
Cmdlet          Stop-Process                                       3.1.0.0    Microsoft.PowerShell.Management                                                                                                         
Cmdlet          Wait-Process                                       3.1.0.0    Microsoft.PowerShell.Management

As you can see above all commands related they follow the same pattern of Verb-Noun. 

Some nouns have prefixes based on the module and the object that you are working on. Below is the list of those prefixes:

  • PS – Powershell
  • AD – Active Directory
  • DHCP – DHCP Server
  • DNS – DNS Server and Client
  • NET – Networking
  • GP – Group Policy
  • VM – Hyper-V
  • SQL – SQL Server
  • Web – Web Administration
  • IIS – IIS Administration
  • SP – SharePoint
  • SPO – SharePoint Online
  • Azure – Azure
  • MSMQ – Microsoft Messaging Queue

After the cmdlet name, parameters maybe supplied. It is not always nessesary to state the name of The parameter, and while some parameters are mandatory, others van be ommited entirely. The are common parameters for all cmdlets and specific parameters for each of the cmdlets. The common parameters are the below:

  • WhatIf
  • Confirm
  • Verbose
  • Debug
  • Warn
  • ErrorAction
  • ErrorVariable
  • OutVariable
  • OutBuffer

I hope the tutorial about PowerShell commands structure is helpful.

Please let me know your comments and thoughts. You feedback is appreciated.

Related Links:

  • PowerShell Tutorials
  • PowerShell Scripts
  • Learning Windows PowerShell Names | Microsoft Docs
Summary
PowerShell Commands Structure
Article Name
PowerShell Commands Structure
Description
This tutorial will provide you information about PowerShell Commands Structure. It will help you understand and memorize the commands easier. Stephanos Constantinou Blog - PowerShell Scripting
Author
Stephanos
Publisher Name
Stephanos Constantinou Blog
Publisher Logo
Stephanos Constantinou Blog

Filed Under: PowerShell Tutorials Tagged With: Get-Command, Get-Verb

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Footer

Recent Posts

  • ICS Cube Product Review 26/04/2019
  • PowerShell Module SysInfo v1.2.0 15/03/2019
  • PowerShell Module SysInfo v1.1.2 13/11/2018
  • PowerShell Module SysInfo 24/10/2018
  • Get-VoltageProbe 24/10/2018
  • Get-VideoController 24/10/2018
  • Get-USBController 24/10/2018
  • Get-TrackPoint 24/10/2018
  • Get-TrackBall 24/10/2018
  • Get-TouchScreen 24/10/2018
Planet PowerShell

Categories

  • Modules Cmdlets (57)
  • PowerShell Modules (5)
  • PowerShell Scripts (38)
  • PowerShell Tutorials (35)
  • Software Reviews (2)

Archives

  • April 2019 (1)
  • March 2019 (1)
  • November 2018 (1)
  • October 2018 (56)
  • September 2018 (13)
  • August 2018 (9)
  • July 2018 (6)
  • June 2018 (8)
  • May 2018 (7)
  • April 2018 (9)
  • March 2018 (4)
  • February 2018 (6)
  • January 2018 (12)
  • December 2017 (4)
Top 10 PowerShell 2018

Blogroll

  • Planet PowerShell
  • Reddit – PowerShell
  • PowerShell Magazine
  • PowerShell.org
  • PowerShell Team Blog
  • Hey, Scripting Guy! Blog
  • Mike F Robbins
  • PowerShell Explained with Kevin Marquette
  • Mike Kanakos – Network Admin
  • The Lonely Administrator
  • AskME4Tech
PowerShell Blogs Sysadmin Blogs Banners for Top 20 Programming Blogs

© 2023 · Stephanos Constantinou Blog

  • Home
  • Blogs
  • About
  • Contact