Click to Rate and Give Feedback
MSDN
MSDN Library
Cmdlet Verb Names

Windows PowerShell uses a verb-noun pair format for the names of cmdlets and their derived .NET classes. For example, the Get-Command cmdlet provided by Windows PowerShell is used to retrieve all commands registered in the Windows PowerShell shell. The verb part of the name identifies the action that the cmdlet performs. The noun part of the name identifies the entity on which the action is performed.

NoteNote:

Windows PowerShell uses the term "verb" to indicate a word that implies an action, even if that word is not a standard verb in the English language. For example, the term "New" is a valid Windows PowerShell verb name because it implies an action, even though it is not a verb in the English language.

Verb Naming Rules

The following list provides guidelines to consider when creating a verb-noun pair:

  • When specifying the verb part of a name, it is strongly recommended to use one of the predefined verb names provided by Windows PowerShell. In doing so, you will ensure consistency between the cmdlets that you create, those cmdlets provided by Windows PowerShell, and cmdlets designed by others.

  • To enforce consistency across cmdlets, do not use a synonym of an approved verb name.

  • Use only the present tense of a verb for a name. For example, use "get" instead of "getting".

  • Use Pascal casing for verb names and noun names.

  • Use a simple, singular noun in cmdlet naming. For example, use "Get-Record" instead of "Get-Records".

Common Verbs

Windows PowerShell uses the VerbsCommon enumeration class to define generic actions and can apply to almost any cmdlet. The following table lists most of the defined verbs.

Verb Name Action Comments

Add

Adds, appends, or attaches an entity to a resource, such as the Add-Content cmdlet. Use with Remove.

Do not use verbs such as append, attach, concatenate, or insert.

Clear

Removes all of the elements or content of a container, such as the Clear-Content cmdlet.

Do not use verbs such as flush, erase, release, unmark, unset, or nullify.

Copy

Copies a resource to another name or another container, such as the Copy-Content cmdlet.

Do not use verbs such as duplicate, clone, or replicate.

Get

Gets the elements of a resource, such as the Get-Content cmdlet. Use with Set.

Do not use verbs such as read, open, cat, type, dir, obtain, dump, acquire, examine, find, or search.

Join

Joins a resource, such as the Join-Path cmdlet. Use with Split.

Do not use combine.

Lock

Locks a resource. Use with Unlock.

Move

Moves a resource to another container.

Do not use verbs such as transfer, name, or migrate.

New

Creates a new resource in a container, such as the New-Object cmdlet.

Do not use verbs such as create, generate, build, make, or allocate.

Remove

Removes a resource from a container, such as the Remove-Item cmdlet. Use with Add.

Rename

Renames a resource in a container, such as the Rename-Item cmdlet.

Select

Selects a resource, such as the Select-Object cmdlet.

Set

Sets the elements of a resource, such as the Set-Content cmdlet. Use with Get.

Do not use verbs such as write, reset, assign, or configure.

Split

Splits a resource, such as the Split-Path cmdlet. Use with Join.

Do not use separate.

Unlock

Unlocks a resource. Use with Lock.

Communications Verbs

Windows PowerShell uses the VerbsCommunications class to define actions that apply to communications. The following table lists most defined verbs.

Verb Name Action Comments

Connect

Associates an activity with a resource. Use with Disconnect.

Disconnect

Disassociates an activity from a resource. Use with Connect.

Read

Reads from a target. Use with Write.

Receive

Acquires elements from a source. Use with Send.

Do not use verbs such as read, accept, or peek.

Send

Sends elements to a destination. Use with Receive.

Do not use verbs such as put, broadcast, mail, or fax.

Write

Writes to a target. Use with Read.

Data Verbs

Windows PowerShell uses the VerbsData class to define actions that apply to data handling. The following table lists most defined verbs.

Verb Name Action Comments

Backup

Backs up data.

Checkpoint

Creates a snapshot of the current state of data or its configuration so that the state can be restored later. Use with Restore.

Do not use verbs such as diff.

Compare

Compares the current resource with another resource and produces a set of differences.

Do not use verbs such as diff.

Convert

Converts one encoding to another or from one unit to another (such as converting from feet to meters).

ConvertFrom

Changes data from one format or encoding to another, where the source format is described by the Noun name of the cmdlet. If data is being copied from a persistent data store, use Import.

ConvertTo

Changes data from one format or encoding to another, where the destination format is described by the Noun name of the cmdlet. If data is being copied to a persistent data store, use Export.

Dismount

Detaches an entity from a pathname location.

Export

Copies a set of resources to a persistent data store. If there is no persistent data store, use Convert, ConvertFrom, or ConvertTo.

Do not use verbs such as extract or backup.

Import

Creates a set of resources from data in a persistent data store, such as a file. If there is no persistent data store, use Convert, ConvertFrom, or ConvertTo.

Do not use verbs such as bulk load or load.

Initialize

Assigns a beginning value to a resource so that it is ready for use.

Do not use verbs such as erase, renew, rebuild, reinitialize, or setup.

Limit

Limits the consumption of a resource or applies a constraint on a resource.

Do not use verbs such as quota.

Merge

Creates a single data instance from multiple instances.

Mount

Attaches an entity to a pathname location. Use with Dismount.

Restore

Rolls back the data state to a predefined set of conditions. Use with Checkpoint.

Update

Updates a resource with new elements.

Do not use verbs such as refresh, renew, recalculate, or re-index.

Out

Sends data out of the environment

Diagnostic Verbs

Windows PowerShell uses the VerbsDiagnostic class to define actions that apply to diagnostics. The following table lists most defined verbs.

Verb Name Action Comments

Debug

Interacts with a resource or activity for the purpose of finding a flaw or a better understanding of what is occurring.

Measure

Identifies the resources that are consumed by a specified operation or retrieves statistics about a resource.

Ping

Determines if a resource is active and responding to requests.

Resolve

Maps a shorthand name to a long name.

Test

Verifies the operation or consistency of a resource.

Do not use verbs such as diagnose, verify, analyze, salvage, or verify.

Trace

Tracks the activities that are performed by a specified operation.

Lifecycle Verbs

Windows PowerShell uses the VerbsLifeCycle class to define actions that apply to the lifecycle of a cmdlet. The following table lists most defined verbs.

Verb Name Action Comments

Disable

Stops an activity of the cmdlet, or configures an item to be unavailable so that it cannot start again. Use with Enable.

Enable

Configures something to be available (for example, to configure something so that it is able to start). Use with Disable.

Install

Places a resource in the indicated location, and optionally initializes it. Use with Uninstall.

Do not use verbs such as set up.

Restart

Terminates existing activity and starts it again with the same configuration. It uses a checkpoint to determine the configuration.

Do not use verbs such as recycle.

Resume

Starts an activity again after it has been suspended. Use with Suspend.

Start

Starts an activity. Use with Stop.

Do not use verbs such as launch, initiate, or boot.

Stop

Discontinues an activity. Use with Start.

Do not use verbs such as end, kill, terminate, or cancel.

Suspend

Pauses an activity. Use with Resume.

Do not use verbs such as pause.

Uninstall

Removes a resource from an indicated location. Use with Install.

Security Verbs

Windows PowerShell uses the VerbsSecurity class to define action that apply to security. The following table lists most defined verbs.

Verb Name Action Comments

Block

Prevents access to a resource. Use with Unblock.

Grant

Grants access to a resource. Use with Revoke.

Revoke

Revokes access to a resource. Use with Grant.

Unblock

Permits access to a resource. Use with Block.

See Also

Footer image

Send comments about this topic to Microsoft.

Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2008 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker