Click to Rate and Give Feedback
MSDN
MSDN Library
Windows PowerShell
 Cmdlet Verbs

  Switch on low bandwidth view
Cmdlet Verbs

Windows PowerShell uses a verb-noun pair for the names of cmdlets and for their derived Microsoft .NET Framework classes. For example, the Get-Command cmdlet provided by Windows PowerShell is used to retrieve all the commands that are registered in Windows PowerShell. 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 describe 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 you choose the verb for a cmdlet name:

  • When you specify the verb, we recommend that you use one of the predefined verb names provided by Windows PowerShell. When you use a predefined verb, you ensure consistency between the cmdlets that you create, the cmdlets that are provided by Windows PowerShell, and the cmdlets that are designed by others.

  • Use the predefined verbs to describe the general scope of the action, and use parameters to further refine the action of the cmdlet.

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

  • Use only the form of each verb that is listed in this topic. For example, use "Get", but do not use "Getting" or "Gets".

  • Use Pascal casing for verbs.

Common Verbs

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

 

Verb Action Comments

Add

Adds a resource to a container, or attaches an item to another item. For example, the Add-Content cmdlet adds content to a file. This verb is paired with the Remove verb.

Do not use verbs such as Append, Attach, Concatenate, or Insert.

Clear

Removes all the resources from a container but does not delete the container. For example, the Clear-Content cmdlet removes the contents of a file but does not delete the file.

Do not use verbs such as Flush, Erase, Release, Unmark, Unset, or Nullify.

Copy

Copies a resource to another name or to another container. For example, the Copy-Item cmdlet that is used to access stored data copies an item from one location in the data store to another location.

Do not use verbs such as Duplicate, Clone, or Replicate.

Enter

Sets the current environment or context to a new context. For example, the Enter-PSSession cmdlet places the user in an interactive session. This verb is paired with the Exit verb.

Do not use verbs such as Push or Into.

Exit

Sets the current environment or context to the most recently used context. For example, the Exit-PSSession cmdlet places the user in the session that was used to start the interactive session. This verb is paired with the Enter verb.

Do not use verbs such as Pop or Out.

Get

Retrieves a resource. For example, the Get-Content cmdlet retrieves the content of a file. This verb is paired with the Set verb.

Do not use verbs such as Read, Open, Cat, Type, Dir, Obtain, Dump, Acquire, Examine, Find, or Search.

Hide

Makes a resource undetectable. For example, a cmdlet whose name includes the Hide verb might conceal a service from a user. This verb is paired with the Show verb.

Do not use verbs such as Block.

Join

Combines resources into one resource. For example, the Join-Path cmdlet combines a path with one of its child paths to create a single path. This verb is paired with the Split verb.

Do not use verbs such as Combine, Unite, Connect, or Associate.

Lock

Secures a resource. This verb is paired with the Unlock verb.

Do not use verbs such as Restrict or Secure.

Move

Moves a resource from one location to another. For example, the Move-Item cmdlet moves an item from one location in the data store to another location.

Do not use verbs such as Transfer, Name, or Migrate.

New

Creates an empty resource that is not associated with any content. (If it does not make sense to create the resource without providing initial data, use the Set verb instead).

Do not use verbs such as Create, Generate, Build, Make, or Allocate.

Pop

Removes an item from the top of a stack. For example, the Pop-Location cmdlet changes the current location to the location that was most recently pushed onto the stack.

Push

Adds an item to the top of a stack. For example, the Push-Location cmdlet pushes the current location onto the stack.

Redo

Resets a resource to the state that was undone.

Remove

Deletes a resource from a container. For example, the Remove-Variable cmdlet deletes a variable and its value. This verb is paired with the Add verb.

Do not use verbs such as Clear, Cut, Dispose, Discard, or Erase.

Rename

Changes the name of a resource. For example, the Rename-Item cmdlet, which is used to access stored data, changes the name of an item in the data store.

Do not use verbs such as Change.

Search

Creates a reference to a resource in a container.

Do not use verbs such as Find or Locate.

Select

Locates a resource in a container. For example, the Select-String cmdlet finds text in strings and files.

Do not use verbs such as Find or Locate.

Set

Creates a resource that contains some data, or replaces data on an existing resource. (Use this verb if it makes no sense to create the resource without attaching data. To create the resource without attaching content, use the New verb. For example, the Set-Date cmdlet changes the system time on the local computer. This verb is paired with the Get verb.

Do not use verbs such as Write, Reset, Assign, or Configure.

Show

Makes a resource visible to the user. This verb is paired with the Hide verb.

Do not use verbs such as Display or Produce.

Split

Separates parts of a resource. For example, the Split-Path cmdlet returns different parts of a path. This verb is paired with the Join verb.

Do not use verbs such as Separate.

Undo

Sets a resource to its previous state.

Unlock

Releases a resource that was locked. This verb is paired with the Lock verb.

Do not use verbs such as Release, Unrestrict, or Unsecure.

Use

Utilizes a resource.

Communications Verbs

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

 

Verb Action Comments

Connect

Creates a link between a source and a destination. This verb is paired with the Disconnect verb.

Do not use verbs such as Join or Telnet.

Disconnect

Breaks the link between a source and a destination. This verb is paired with the Connect verb.

Do not use verbs such as Break or Logoff.

Read

Acquires information from a source. This verb is paired with the Write verb.

Do not use verbs such as Acquire, Prompt, or Get.

Receive

Accepts information sent from a source. This verb is paired with the Send verb.

Do not use verbs such as Read, Accept, or Peek.

Send

Delivers information to a destination. This verb is paired with the Receive verb.

Do not use verbs such as Put, Broadcast, Mail, or Fax.

Write

Adds information to a target. This verb is paired with the Read verb.

Do not use verbs such as Put or Print.

Data Verbs

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

 

Verb Name Action Comments

Backup

Stores data by replicating it.

Do not use verbs such as Save or Burn.

Checkpoint

Creates a snapshot of the current state of the data or of its configuration.

Compare

Evaluates the data from one resource against the data from another resource.

Do not use verbs such as Diff.

Compress

Compacts the data of a resource.

Do not use verbs such as Compact.

Convert

Changes the data from one representation to another when the cmdlet supports bidirectional conversion or when the cmdlet supports conversion between multiple data types.

Do not use verbs such as Change, Resize, or Resample.

ConvertFrom

Converts one primary type of input (the cmdlet noun indicates the input) to one or more supported output types.

Do not use verbs such as Export, Output, or Out.

ConvertTo

Converts from one or more types of input to a primary output type (the cmdlet noun indicates the output type).

Do not use verbs such as Import, Input, or In.

Dismount

Detaches a named entity from a location.

Do not use verbs such as Unlink.

Expand

Restores the data of a resource that has been compressed to its original state. This verb is paired with the Compress verb.

Do not use verbs such as Explode.

Export

Encapsulates the primary input into a persistent data store, such as a file, or into an interchange format. This verb is paired with the Import verb.

Do not use verbs such as Extract or Backup.

Import

Creates a resource from data that is stored in a persistent data store (such as a file) or in an interchange format. For example, the Import-CSV cmdlet imports data from a comma-separated value (CSV) file to objects that can be used by other cmdlets. This verb is paired with the Export verb.

Do not use verbs such as BulkLoad or Load.

Initialize

Prepares a resource for use, and sets it to a default state.

Do not use verbs such as Erase, Renew, Rebuild, Reinitialize, or Setup.

Invoke

Performs an action, such as running a command or a method.

Do not use verbs such as Run or Start.

Limit

Applies constraints to a resource.

Do not use verbs such as Quota.

Merge

Creates a single resource from multiple resources.

Do not use verbs such as Combine or Join.

Mount

Attaches a named entity to a location.

Out

Sends data out of the environment. For example, the Out-Printer cmdlet sends data to a printer.

Publish

Makes a resource available to others. This verb is paired with the Unpublish verb.

Do not use verbs such as Deploy, Release, or Install.

Redo

Repeats the last action on a resource. This verb is paired with the Undo verb.

Restore

Sets a resource to a predefined state, such as a state set by using the Checkpoint verb.

Do not use verbs such as Repair, Return, Undo, or Fix.

Save

Preserves data to avoid loss.

Undo

Returns a resource to its previous state. This verb is paired with the Redo verb.

Unpublish

Makes a resource unavailable to others. This verb is paired with the Publish verb.

Do not use verbs such as Uninstall, Revert, or Hide.

Update

Sets a resource to a new state. For example, the Update-FormatData cmdlet updates and adds formatting files to the current Windows PowerShell console.

Do not use verbs such as Refresh, Renew, Recalculate, or Re-index.

Diagnostic Verbs

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

 

Verb Name Action Comments

Debug

Examines a resource to diagnose operational problems.

Do not use verbs such as Diagnose.

Measure

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

Do not use verbs such as Calculate, Determine, or Analyze.

Ping

Determines if a resource is active and if it is responding to requests.

Do not use verbs such as Connect or Test.

Resolve

Maps a shorthand representation of a resource to a more complete representation.

Do not use verbs such as Expand or Determine.

Repair

Restores a resource to a usable condition.

Test

Verifies the operation or consistency of a resource.

Do not use verbs such as Diagnose, Analyze, Salvage, or Verify.

Trace

Tracks the activities of a resource.

Do not use verbs such as Track, Follow, Inspect, or Dig.

Lifecycle Verbs

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

 

Verb Action Comments

Complete

Concludes an operation.

Disable

Configures a resource to an unavailable or inactive state. For example, the Disable-PSBreakpoint cmdlet makes a breakpoint inactive. This verb is paired with the Enable verb.

Do not use verbs such as Halt or Hide.

Enable

Configures a resource to an available or active state. For example, the Enable-PSBreakpoint cmdlet makes a breakpoint active. This verb is paired with the Disable verb.

Do not use verbs such as Start or Begin.

Install

Places a resource in a location, and optionally initializes it. This verb is paired with the Uninstall verb.

Do not use verbs such as Setup.

Register

Creates an entry for a resource in a repository such as a database. This verb is paired with the Unregister verb.

Restart

Stops an operation and then starts it again. For example, the Restart-Service cmdlet stops and then starts a service.

Do not use verbs such as Recycle.

Resume

Starts an operation that has been suspended. For example, the Resume-Service cmdlet starts a service that has been suspended. This verb is paired with the Suspend.

Start

Initiates an operation. For example, the Start-Service cmdlet starts a service. This verb is paired with the Stop verb.

Do not use verbs such as Launch, Initiate, or Boot.

Stop

Discontinues an activity. This verb is paired with the Start verb.

Do not use verbs such as End, Kill, Terminate, or Cancel.

Suspend

Pauses an activity. For example, the Suspend-Service cmdlet pauses a service. This verb is paired with the Resume verb.

Do not use verbs such as Pause.

Uninstall

Removes a resource from an indicated location. This verb is paired with the Install verb.

Unregister

Removes the entry for a resource from a repository. This verb is paired with the Register verb.

Do not use verbs such as Remove.

Wait

Pauses an operation until a specified event occurs. For example, the Wait-PSJob cmdlet pauses operations until one or more of the background jobs are complete.

Do not use verbs such as Sleep or Pause.

Security Verbs

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

 

Verb Action Comments

Block

Restricts access to a resource. This verb is paired with the Unblock verb.

Do not use verbs such as Prevent, Limit, or Deny.

Grant

Allows access to a resource. This verb is paired with the Revoke verb.

Do not use verbs such as Allow or Enable.

Revoke

Does not allow access to a resource. This verb is paired with the Grant verb.

Do not use verbs such as Remove or Disable.

Unblock

Removes restrictions to a resource. This verb is paired with the Block verb.

Do not use verbs such as Clear or Allow.

Reserved Verbs

Do not use the following reserved verbs. These verbs are used by the Windows PowerShell language.

  • ForEach

  • Format

  • Group

  • Sort

  • Tee

  • Where

See Also



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