Verb Name Guidelines

Windows PowerShell uses a verb-noun pair format to name a cmdlet and its derived .NET class. For example, the Get-Command cmdlet provided by Windows PowerShell is used to retrieve all the commands that are registered in the shell. As you can see, the verb part of a name identifies the action that the cmdlet performs. The noun part of the name identifies the entity on which the action is performed.

Simple Verb Naming Rules

Here are some simple rules to follow when naming verbs:

  • When specifying the verb part of a name, use one of the predefined verb names provided by Windows PowerShell. By using one of these predefined verbs, you will ensure consistency between the cmdlets that you create and those provided by Windows PowerShell and 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 a simple, singular noun in cmdlet naming. For example, use "Get-Record" instead of "Get-Records".

Common Verbs

Windows PowerShell uses the VerbsCommon class to define verbs that are general in nature and can apply to almost any cmdlet. Most of the defined verbs are summarized in the following table.

Verb Name Description Comments

Add

This verb adds a resource to a container or attaches an element to another element. Use with Remove.

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

Clear

This verb removes all the elements from a container.

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

Copy

This verb copies a resource to another name or another container.

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

Get

This verb retrieves data. Use with Set.

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

Lock

This verb locks a resource. Use with Unlock.

Not applicable.

Move

This verb moves a resource.

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

New

This verb creates a new resource.

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

Remove

This verb removes a resource from a container. Use with Add.

Not applicable.

Rename

This verb gives a resource a new name.

Not applicable.

Set

This verb places some data. Use with Get.

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

Unlock

This verb unlocks a resource. Use with Lock.

Not applicable.

Communications Verbs

Windows PowerShell uses the VerbsCommunications class to define verbs that apply to communications. Most of the defined verbs are summarized in the following table.

Verb Name Description Comments

Connect

This verb connects a source to a destination. Use with Disconnect.

Not applicable.

Disconnect

This verb disconnects a source from a destination. Use with Connect.

Not applicable.

Receive

This verb acquires information from a source. Use with Send.

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

Send

This verb writes information to a destination. Use with Receive.

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

Data Verbs

Windows PowerShell uses the VerbsData class to define verbs that apply to data handling. Most of the defined verbs are summarized in the following table.

Verb Name Description Comments

Backup

This verb backs up data.

Not applicable.

Checkpoint

This verb 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

This verb compares the current resource with another resource and produces a set of differences.

Do not use verbs such as diff.

Convert

This verb changes from one format or encoding to another, or from one unit base to another.

Not applicable.

Export

This verb makes a copy of a set of resources using an interchange format.

Do not use verbs such as extract or back up.

Import

This verb creates a set of resources using an interchange format.

Do not use verbs such as bulk load or load.

Initialize

This verb prepares a resource for use and initializes it with a beginning value.

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

Limit

This verb limits the consumption of or applies a constraint to a resource.

Do not use verbs such as quota.

Merge

This verb creates a single data instance from multiple instances.

Not applicable.

Restore

This verb rolls back the data state to a predefined set of conditions. Use with Checkpoint.

Not applicable.

Update

This verb updates or refreshes a resource.

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

Diagnostic Verbs

Windows PowerShell uses the VerbsDiagnostic class to define verbs that apply to diagnostics. Most of the defined verbs are summarized in the following table.

Verb Name Description Comments

Debug

This verb acts on a resource or activity to examine its operation and diagnose any operational problems.

Not applicable.

Measure

This verb identifies resources consumed by a specified operation, or retrieves statistics about a resource.

Not applicable.

Ping

This verb determines if a resource is active and responding to requests.

Not applicable.

Resolve

This verb maps a shorthand name to a long name.

Not applicable.

Test

This verb verifies the operational validity or consistency of a resource.

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

Trace

This verb follows activities performed by a specified operation.

Not applicable.

Lifecycle Verbs

Windows PowerShell uses the VerbsLifeCycle class to define verbs that apply to the life cycle of a cmdlet. Most of the defined verbs are summarized in the following table.

Verb Name Description Comments

Disable

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

Not applicable.

Enable

This verb starts an activity of the cmdlet, or it configures an item to be available. Use with Disable.

Not applicable.

Install

This verb places a resource in the indicated location and optionally initializes it. Use with Uninstall.

Do not use verbs such as set up.

Restart

This verb 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

This verb begins an activity again after it has been suspended. Use with Suspend.

Not applicable.

Start

This verb begins an activity. Use with Stop.

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

Stop

This verb discontinues an activity. Use with Start.

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

Suspend

This verb halts an activity temporarily. Use with Resume.

Do not use verbs such as pause.

Uninstall

This verb removes a resource from an indicated location. Use with Install.

Not applicable.

Security Verbs

Windows PowerShell uses the VerbsSecurity class to define verbs that apply to security. Most of the defined verbs are summarized in the following table.

Verb Name Description Comments

Block

This verb prevents access to a resource. Use with Unblock.

Not applicable.

Grant

This verb grants access to a resource. Use with Revoke.

Not applicable.

Revoke

This verb revokes access to a resource. Use with Grant.

Not applicable.

Unblock

This verb permits access to a resource. Use with Block.

Not applicable.

See Also

Concepts

Windows PowerShell Programmer's Guide

Other Resources

Windows PowerShell SDK

Footer image