Have you ever heard “PowerShell verbs” and wondered what in the world it means? This guide will teach you everything you need to know about verbs in PowerShell.
To make this an exciting read, there are sections in this article starting with an overview of the topic. Then, in the second section, you will learn how PowerShell verbs work. Categories of approved verbs will follow this. In this section, you will learn Common, Communications, Data, Diagnostic, Lifecycle, and Security Verbs.
Finally, you can read the FAQ section, where we answer commonly asked questions about this topic.
Overview Of PowerShell Verbs
If you’ve ever worked with PowerShell cmdlets, you’ve probably noticed that they all have the same naming convention. Cmdlets, in particular, use a Verb-Noun pair naming convention.
The “verb” part of the name describes the action the cmdlet takes. On the other hand, a cmdlet’s “noun” portion defines the entity on which the step is performed.
PowerShell uses the term “verb” to identify an action that a cmdlet performs. However, not all cmdlet verbs are necessary verbs in the English Language. A good example of a PowerShell “verb” that is not an English Language verb is the word “New.”
Microsoft has a list of “approved” verbs that developers can use to name their cmdlets or advanced PowerShell functions to standardize cmdlet naming. Microsoft also classified the approved verbs into six categories.
As mentioned in the introduction, approved cmdlet verbs are divided into Common, Communications, Data, Diagnostic, Lifecycle, and Security categories. Later in this article, we will list and explain each category’s verbs.
So, why should you learn cmdlet verbs? For two reasons.
- Understanding how PowerShell names verbs will assist you in finding the cmdlets you require to perform tasks and write scripts.
- You will need to use the approved verb to develop a custom cmdlet.
Read also; Amazon Echo Simple Tips and Tricks
How PowerShell Verb Naming Works
As mentioned in the last section, PowerShell cmdlets follow a “Verb-Noun” naming convention. Keep this in mind when creating a cmdlet or advanced function.
In this next section, we will discuss the predefined PowerShell verbs and the conditions to use them.
Moving on, Microsoft recommends avoiding using verb synonyms in addition to PowerShell verbs. Using actual “verbs” makes understanding what your cmdlet or function does simple.
You should also avoid using PowerShell-reserved verbs or aliases when naming your cmdlets and advanced functions.
Microsoft says that the following verbs – Where (wh), ForEach (foreach), Ping (pi), Tee (te), Sort (sr) – are reserved by PowerShell, and you should avoid using them.
Approved PowerShell Verbs By Categories
This section will discuss all approved PowerShell verbs by their categories. To list the verbs we discuss in this section, run the command below:
Read more; Starlink vs. Centurylink: Which is Better
Common PowerShell Verbs
The table below lists all the PowerShell verbs belonging to the category of “Common” verbs. In the first column, we list the verb and then add the alias of the verb in brackets ().
|PowerShell Common Verb (Alias)||Actions/Tasks They Perform|
|Add (a)||Adds an item to a container or attaches an item to another item. An example is the Add-Computer commandlet – it adds the local computer to a domain or workgroup.|
|Clear (cl)||Removes all items in a container but does not delete the container itself. A good example is Clear-Content – which deletes the contents of an item like a file, whereas it does not delete the item.|
|Close (cs)||Changes the state of a resource to make it unavailable, inaccessible, or unusable. For example, Close-SmbSession forcibly ends an SMB session.|
|Copy (cp)||Use the “Copy” to copy an item to another name or container. For example, Copy-Item copies an item from one location (a folder) to another.|
|Enter (et)||The PowerShell verb “Enter” specifies an action that allows the user to move into a resource. A good example is Enter-PSSession which starts an interactive PowerShell session with a remote computer.|
|Exit (ex)||The “Exit” verb sets the current environment or context to the most recently used context. An example is the Exit-PSSession. This cmdlet ends an interactive PowerShell session with a remote computer.|
|Find (fd)||The PowerShell verb “Find” looks for an object in a container. For example, Find-Module finds modules that match specified criteria in a repository.|
|Format (f)||Arranges objects in a specified format or form. A great example is a Format-Table command.|
|Get (g)||The “Get” verb defines an action that retrieves a resource. This is a very common verb. To list all cmdlets with the “Get” verb, run the command – Get-Command -Verb Get.|
|Hide (h)||The PowerShell verb “Hide” makes a resource undetectable. For example, Hide-VirtualDisk hides the virtual disk from the host when the Storage Management Provider in use does not support masking sets.|
|Join (j)||The “Join” verb combines resources into one resource. A good example is the Join-Path cmdlet which merges a path and a child path into a single path.|
|Lock (lk)||The “Lock” verb secures an item or resource. An example of a cmdlet that uses the “Lock” verb is Lock-BitLocker. The Lock-BitLocker cmdlet prevents access to encrypted data on a BitLocker volume.|
|Move (m)||“Move” moves a resource from one location to another. A good example is the Move-ADObject Active Directory cmdlet which moves an AD object or a container of objects to a different container or domain.|
|New (n)||The “New” PowerShell verb creates an item that did not exist. For example, the New-ADObject Active Directory cmdlet creates an AD object that does not exist in the directory.|
|Open (op)||Changes the state of an item or resource to make it accessible, available, or usable. The “Open” verb is the opposite of “Close” – see the definition of this verb above. An example of a cmdlet that uses the “Open” verb is Open-NetGPO. The Open-NetGPO cmdlet caches the Group Policy Object (GPO) so that you can make modifications locally.|
|Optimize (om)||Use the “Optimize” verb in cmdlets that increase the effectiveness of a resource. For example, Optimize-Volume optimizes a volume. Specifically, it defragments and trims a volume.|
|Pop (pop)||This verb removes an item from the top of a stack. An example is the Pop-Location cmdlet which changes the current location to the location most recently pushed onto the stack.|
|Push (pu)||The “Push” PowerShell verb adds an item to the top of a stack. A good example of a cmdlet that uses the “Push” verb is Push-Location – which adds the current location to the top of a location stack.|
|Redo (re)||Use the “Redo” in cmdlets that reset a resource to the state that was undone. For example, the Redo-MsolProvisionUser retries the provisioning of a user object in the Azure Active Directory.|
|Remove (r)||PowerShell cmdlets that use the “Remove” verb delete a resource from a container. For example, Remove-Item deletes one or more items (file, folder, or registry item).|
|Rename (rn)||The “Rename” verb changes the name of a resource. For example, the Rename-Item cmdlet renames an item in a PowerShell provider namespace.|
|Reset (rs)||Cmdlets that use the “Reset” verb set a resource back to its original state. An example is the Reset-PhysicalDisk cmdlet, which resets the status of a physical disk.|
|Resize (rz)||The “Resize” PowerShell verb changes the size of a resource. For example, the Resize-Partition cmdlet resizes a partition and the underlying file system.|
|Search (sr)||The “Search” verb creates a reference to a resource in a container. An excellent example is the Search-ADAccount Active Directory PowerShell cmdlet. The Search-ADAccount cmdlet gets Active Directory user, computer, or service accounts.|
|Select (sc)||PowerShell cmdlets with the “Select” verb locate a resource in a container. A common example is a Select-Object cmdlet which selects specified properties of an object or set of objects.|
|Set (s)||The verb “Set” substitutes data on an existing resource or creates a resource that contains some data. For example, Set-Disk takes a Disk object or unique disk identifiers and a set of attributes and updates the physical disk on the system.|
|Show (sh)||This verb makes a resource visible to the user. An interesting cmdlet that uses the “Show” verb is the Show-Command which displays PowerShell command information in a graphical window.|
|Skip (sk)||The “Skip” PowerShell verb omits one or more resources or points in a sequence.|
|Split (sl)||The “Split” verb separates parts of a resource. An example is a Split-Path cmdlet that returns only the specified part of a path, such as a parent folder, a subfolder, or a file name.|
|Step (st)||“Step” PowerShell verb moves to the next point or resource in a sequence.|
|Switch (sw)||The “Switch” PowerShell verb specifies an action that alternates between two resources. For example, a “Switch” verb could cause a change between two locations, responsibilities, or states. An example of a cmdlet with this verb is Switch-Certificate. This cmdlet marks one certificate as having been replaced by another certificate.|
|Undo (un)||“Undo” sets a resource to its previous state. For example, the Undo-Transaction cmdlet rolls back the active transaction.|
|Unlock (uk)||The “Unlock” PowerShell verb releases a resource that was previously locked. An excellent example is the Unlock-ADAccount Active Directory PowerShell cmelst. Unlock-ADAccount restores AD access for an account that is locked.|
|Watch (wc)||“Watch” continuously checks or monitors a resource for changes.|
Communications PowerShell Verbs
In the last sub-section, we listed and explained the category of “Common” verbs. In the table below, we have listed and explained verbs that fall under the “Communications” PowerShell Verbs category.
|PowerShell Communications Verb (Alias)||Actions/Tasks They Perform|
|Connect (cc)||The “Connect” verb creates a link between a source and a destination. A good example is the Connect-AzureAD cmdelet which connects the current PowerShell session to an Azure Active Directory tenant.|
|Disconnect (dc)||The “Disconnect” PowerShell verb breaks the link between a source and a destination. For example, the Disconnect-AzureAD Azue AD cmdlet disconnects the current session from an Azure Active Directory tenant.|
|Read (rd)||The “Read” verb is used in cmdlets that acquire information from a source. A common example of a cmdlet that uses this verb is the Read-Host cmdlet.|
|Receive (rc)||PowerShell cmdlets that use the “Receive” verb accepts information sent from a source. A good example is the Receive-PSSession cmdlet which gets the results of commands in disconnected PowerShell sessions.|
|Send (sd)||This verb is paired with the “Receive” verb. The “Send” verb supplies information to a destination. An example is the Send-MailMessage cmdlet which sends an email message.|
|Write (wr)||The “Write” PowerShell verb is a common verb. Cmdlets that use this verb adds information to a target. For example, the Write-Host cmdlet writes customized output to a host (PowerShell console).|
Data PowerShell Verbs
Data verbs perform tasks such as backup, checkpoint creation, and comparison. The following are the approved PowerShell verbs and their definitions.
|PowerShell Data Verb (Alias)||Actions/Tasks They Perform|
|Backup (ba)||The “Backup” verb replicates data to a destination. For example, the Backup-GPO cmdlet backs up one GPO or all the GPOs in a domain.|
|Checkpoint (ch)||PowerShell cmdlets with the “Checkpoint” verb create a snapshot of the current state of the data or its configuration. An example is the Checkpoint-Computer cmdlet, which creates a system restore point on the local computer.|
|Compare (cr)||The “Compare” verb is used in cmdlets that assess the data from one resource against another. When you think of the “compare” verb, the Compare-Object cmdlet comes to mind. This cmdlet compares two sets of objects. It is relevant to mention my custom advanced function – Compare-TextStrings – which compares two text strings.|
|Compress (cm)||If you want to create a cmdlet or advanced function that compacts the data of a resource, use the “Compress” verb to name the cmdlet or function. A food example is a Compress-Archive cmdlet which creates a compressed archive, or zipped file, from specified files and folders.|
|Convert (cv)||When the cmdlet with the “Convert” verb supports bidirectional conversion, the cmdlet changes the data from one representation to another, or when the cmdlet supports conversion between multiple data types. A valid example is the Convert-Path cmdlet which converts a path from a PowerShell path to a PowerShell provider path.|
|ConvertFrom (cf)||PowerShell cmdlets with the “ConvertFrom” verb convert one primary input type (the cmdlet noun indicates the input) to one or more supported output types. For example, the ConvertFrom-Csv cmdlet creates are CSV versions of the original objects.|
|ConvertTo (ct)||This verb converts from one or more types of input to a primary output type (the cmdlet noun indicates the output type). A great example is the ConvertTo-Csv cmdlet which converts .NET objects into a series of comma-separated value (CSV) strings.|
|Dismount (dm)||The “Dismount” verb detaches a named entity from a location. A good example is a Dismount-WindowsImage cmdlet – which dismounts a Windows image from the directory it is mapped to.|
|Edit (ed)||The “Edit” verb is used in cmdlets that modify existing data by adding or removing content.|
|Expand (en)||Restores the data of a resource that has been compressed to its original state. This verb is the opposite of “compress.”|
|Export (ep)||The “Export” verb is used in cmdlets that enclose the primary input into a persistent data store, such as a file, or into an interchange format. For example, Export-CSV converts objects into a series of comma-separated value (CSV) strings and saves the strings to a file.|
|Group (gp)||PowerShell “Group” verb cmdlets arrange or associate one or more resources. A great example is the Group-Object cmdlet, which groups object with the same value for specified properties.|
|Import (ip)||The “Import” verb creates a resource from data stored in a persistent data store (such as a file) or an interchange format. An excellent example is an Import-CSV cmdlet which imports data from a comma-separated value (CSV) file.|
|Initialize (in)||The “Initialize” verb prepares a resource for use and sets it to a default state. The most appropriate cmdlet example is Initialize-Disk – which Initializes a RAW disk for first-time use. When the Initialize-Disk cmdlet initializes a disk, it prepares the disk to be formatted and used to store data.|
|Limit (l)||“Limit” verbs apply constraints to a resource. An example is the Limit-EventLog cmdlet which sets the event log properties that limit the size of the event log and the age of its entries.|
|Merge (mg)||Cmdlets with the “Merge” verb create a single resource from multiple resources. For example, the Merge-VHD cmdlet combines virtual hard disks.|
|Mount (mt)||The PowerShell “Mount” verb attaches a named entity to a location. The Mount-WindowsImage is a great example. This cmdlet mounts a Windows image in a WIM or VHD file to a directory on the local computer.|
|Out (o)||Cmdlets that use the “Out” verb send data out of the environment. For example, the Out-File cmdlet sends output to a file.|
|Publish (pb)||A “Publish” verb makes a resource available to others. For example, the Publish-Module cmdlet publishes a specified module from the local computer to an online gallery.|
|Restore (rr)||The PowerShell “Restore” verb sets a resource to a predefined state. An example of a predefined state Checkpoint. an example of a cmdlet that uses the “Restore” verb is Restore-Computer. This cmdlet restores the local computer to the specified system restore point.|
|Save (sv)||The “Save” verb keeps data to avoid loss. For example, the Save-WindowsImage cmclet DISM cmdlet applies modifications to a mounted image to its WIM or VHD file.|
|Sync (sy)||The “Sync” verb ensures that two or more resources are in the same state. A good example is the Sync-ADObject Active Directory cmdlet, which replicates a single object between any domain controllers with common parts.|
|Unpublish (ub)||The PowerShell “Unpublish” verb makes a resource unavailable to others. For example, the Unpublish-AppvClientPackage removes the extension points for packages.|
|Update (ud)||The “Update” verb brings a resource up-to-date to maintain its state, accuracy, conformance, or compliance.|
Diagnostic PowerShell Verbs
PowerShell verbs that perform diagnostic functions help you determine problems with existing configurations. we have listed and explained the approved Diagnostic PowerShell Verbs in the table below.
|PowerShell Diagnostic Verb (Alias)||Actions/Tasks They Perform|
|Debug (db)||The “Debug” verb examines a resource to diagnose operational problems. Some common examples of cmdlets that use this verb are Debug-Process, Debug-Volume, and Debug-VM.|
|Measure (ms)||Cmdlets with the “Measure” verb determine resources that are consumed by a specified operation or retrieve statistics about a resource. Some examples of cmelsts that use the “Measure” verb are Measure-Object, Measure-Command, and Measure-VM.|
|Repair (rp)||The “Repair” verb restores a resource to a usable condition. An example is the Repair-WindowsImage cmdlet which repairs a Windows image in a WIM or VHD file.|
|Resolve (rv)||The “Resolve” PowerShell verb maps a shorthand expression of a resource to a complete representation. Some common examples are Resolve-DnsName, Resolve-Path, and Resolve-PSFPath.|
|Test (t)||“Test” verb cmdlets confirm the operation or consistency of a resource. For example, Test-Path determines whether all elements of a path exist.|
|Trace (tr)||PowerShell “Trace” verb tracks the activities of a resource.|
Lifecycle PowerShell Verbs
Lifecycle verbs define actions that occur during a resource’s lifecycle. The following verbs are acceptable in this category.
|PowerShell Lifecycle Verb (Alias)||Actions/Tasks They Perform|
|Approve (ap)||The “Approve” verb approves or agrees to the status of a resource or process.|
|Assert (as)||The “Assert” PowerShell verb proves the state of a resource.|
|Build (bd)||The “Build” verb creates an artifact (usually a binary or document) out of some set of input files (usually source code or declarative documents.)|
|Complete (cp)||PowerShell cmdlets that use the “Complete” verb ends an operation. An example is the Complete-Transaction cmdlet which commits an active transaction.|
|Confirm (cn)||The “Confirm” verb accepts, confirms, or validates the state of a resource or process. Some examples are Confirm-AzureADDomain and Confirm-MsolDomain.|
|Deny (dn)||PowerShell cmdlets that use the “Deny” verb objects block or oppose the state of a resource or process.|
|Deploy (dp)||Microsoft added this verb in PowerShell 6. The “Deploy” PowerShell verb transmits an application, website, or solution to a remote target(s) such that the person who consumes that solution can access it after deployment.|
|Disable (d)||The “Disable” PowerShell verb changes the state of a resource to make it unavailable. A great example is the Disable-LocalUser cmdlet which disables a specified local user account.|
|Enable (e)||This is the opposite verb of the “Disable” verb. The “Enable” verb changes the state of a resource to make available. For example, the Enable-LocalUser cmdlet enables local user accounts.|
|Install (is)||The “Install” verb puts a resource in a location and optionally initializes it. For example, the Install-Module downloads one or more PowerShell modules from a repository – then installs them on the local computer.|
|Invoke (i)||The “Invoke” PowerShell verb completes an action, such as running a command or a method. An excellent example is the Invoke-Command which runs commands on local and remote computers.|
|Register (rg)||This verb creates an entry for a resource in a repository, such as a database. For example, the Register-WmiEvent cmdlet subscribes to Windows Management Instrumentation (WMI) events on a local or remote computer.|
|Request (rq)||The “Request” verb requests for a resource or asks for permissions.|
|Restart (rt)||PowerShell cmdlets that use the “Restart” verb stop and restart an operation. The Restart-Computer cmdlet, for example, shuts down and then restarts the operating system on local and remote computers.|
|Resume (ru)||The “Resume” verb starts an operation that was previously suspended. For example, the cmdlet, Resume-Service resumes one or more suspended (paused) services.|
|Start (sa)||PowerShell cmdlets that use the “Start” verb start an operation. A great example is the Start-Service cmdlet which starts a service.|
|Stop (sp)||The “Stop” verb quits (stops) an activity. For example, the Stop-Service cmdlet stops a service.|
|Submit (sb)||This verb sends a resource for approval.|
|Suspend (ss)||The “Suspend” verb pauses an activity temporarily. A great example is the Suspend-Service cmdlet which pauses a service.|
|Uninstall (us)||This is the inverse of “Install.” The “Uninstall” verb deletes a resource from the specified location. The Uninstall-Module cmdlet, for example, removes a specified module from the local computer.|
|Unregister (ur)||PowerShell cmdlets that use the “Unregister” verb remove the entry for a resource from a repository. An example is an Unregister-Event cmdlet which cancels an event subscription that was created with the |
|Wait (w)||The verb “Wait” stops an operation until a specific event occurs. The Wait-Process cmdlet, for example, waits for one or more running processes to be terminated before receiving input.|
Security PowerShell Verbs
Security verbs, as expected, define actions related to security. The table below lists and describes all of the approved PowerShell security verbs.
|PowerShell Security Verb (Alias)||Actions/Tasks They Perform|
|Block (bl)||This verb limits the availability of a resource. The Block-FileShareAccess cmdlet, for example, prevents access to the specified file share for the specified accounts. This is accomplished by adding an access-denied access control entry (ACE) to the share’s security descriptor.|
|Grant (gr)||The “Grant” verb permits access to a resource. For example, the Grant-FileShareAccess cmdlet grants access to a file share for the specified accounts by adding an Allow access control entry (ACE) to the share’s security descriptor.|
|Protect (pt)||The “Protect” verb in PowerShell cmdlets protects a resource from attack or loss. Protect-CmsMessage is an example of a cmdlet that uses this verb. The Protect-CmsMessage cmdlet uses the Cryptographic Message Syntax format to encrypt the content.|
|Revoke (rk)||This verb describes an action that prevents access to a resource. The Revoke-FileShareAccess cmdlet is an example of a cmdlet that uses this verb. This cmdlet removes the Allow access control entries (ACE) for a trustee from a file share’s security descriptor.|
|Unblock (ul)||The verb “Unblock” removes restrictions from a resource. Unblock-FileShareAccess, for example, removes all Deny access control entries (ACE) for the specified trustee from the share’s security descriptor.|
|Unprotect (up)||This verb is the opposite of the “Protect” verb. The “Unprotect” verb removes safeguards from a resource that were added to prevent it from attack or loss.|
Comparable Verbs That Perform Different Tasks
In the previous section, we listed and explained the approved verbs and their categories. You may have noticed that some of the verbs perform the same function.
Because of this apparent ambiguity, it is also necessary to list these verbs that are similar but perform different tasks. This is vital for two reasons:
- Knowing this information will help you improve your search for cmdlets to perform your tasks.
- Additionally, understanding the differences in how these similar verbs are used will help you use the correct verbs for your cmdlets.
Start vs. Invoke
Use the “Start” verb if your cmdlet or advanced function performs asynchronous operations, such as starting an independent process. The Start-Process cmdlet is a good example.
To list all PowerShell cmdlets on your computer with the “Start” verb, run the command below.
Get-Command -Verb Start
In contrast, use the verb “Invoke” if your cmdlet executes synchronous operations. In case you were wondering, a synchronous operation is one in which you must wait for one command to complete before executing another.
Run the following command to list every cmdlet on your computer that uses the verb “Invoke”:
Get-Command -Verb Invoke
Set vs. New
If you’re wondering when to use “Set” or “New”, here is how…
Use “New” if your cmdlet creates a new item. On the contrary, use “Set” if you want to modify an existing item.
The cmdlet New-Item, for example, creates a new folder or file, whereas Set-Item modifies an existing folder or file. Run the following commands to see a list of all PowerShell cmdlets with the verbs “New” or “Set.”
Get-Command -Verb New Get-Command -Verb Set
This knowledge is also useful in locating the cmdlet required to complete a task. For example, if we want to change my OS Edition but don’t know which command to use, we can use the following commands to locate the required cmdlet.
Get-Command -Verb Set -Noun "*Edition*"
The command returns the Set-WindowsEdition command.
Set vs. Add
As I mentioned in the last subsection, we mentioned that you use “Set” to modify an existing item. However, if you want to add to an existing item, use the “Add” verb.
Add-Content is a good example of a cmdlet that uses the “Add” verb. This adds information to a new file. However, if you want to modify or replace the content of a text file, use Set-Content.
Find vs. Search
This is yet another set of PowerShell verbs that perform similar functions. If you need to find something, use the verb “Find.”
If you want to reference a container, you can use the “Search” verb instead.
See Also; New Jailbreak Release For PS4 & PS5: How To Prepare For It
FAQs About Approved PowerShell Verbs
What Are PowerShell Verbs?
The naming convention for PowerShell cmdlets is Verb-Noun. The “verb” part of a cmdlet’s name describes the action that the cmdlet takes.
What is the function Get-Verb in PowerShell?
The Get-Verb cmdlet returns a list of all the valid PowerShell verbs. Furthermore, the command categorizes the verbs.
Is PowerShell A Valuable Skill?
Absolutely! PowerShell is a skill that will help you in your current job if you are a SysAdmin.
Furthermore, if you need to change jobs, including PowerShell skills on your resume will undoubtedly increase your chances of landing a high-paying SysAdmin position.
Why Are There Approved Verbs in PowerShell?
Microsoft developed approved verbs to create standardization. Because approved verbs are used, everyone follows the same rules when creating cmdlets and advanced functions.