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 Remove.

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.

Close

Changes the state of a resource to make it inaccessible, unavailable, or unusable. This verb is paired with Open.

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

Specifies an action that allows the user to move into a resource. For example, the Enter-PSSession cmdlet places the user in an interactive session. This verb is paired with Exit.

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 Enter.

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 Set.

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

Find

Looks for an object in a container that is unknown, implied, optional, or specified.

Format

Arranges objects in a specified form or layout.

Get

Specifies an action that retrieves a resource. This verb is paired with Set.

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

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 Show.

Do not use a verb 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 Split.

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

Lock

Secures a resource. This verb is paired with Unlock.

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.

Open

Changes the state of a resource to make it accessible, available, or usable. This verb is paired with Close.

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 Add.

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 a verb such as Change.

Reset

Sets a resource back to its original state.

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 Get.

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

Show

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

Do not use verbs such as Display or Produce.

Skip

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

Do not use a verb such as Separate.

Split

Specifies an action that separates parts of a resource. This verb is paired with Join.

Do not use a verb such Separate.

Step

Moves to the next point or resource in a sequence.

Switch

Specifies an action that alternates between two resources, such as to change between two locations, responsibilities, or states.

Undo

Sets a resource to its previous state.

Unlock

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

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

Watch

Continually inspects or monitors a resource for changes.

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 Disconnect.

Do not use verbs such as Join or Telnet.

Disconnect

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

Do not use verbs such as Break or Logoff.

Read

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

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

Receive

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

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

Send

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

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

Write

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

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.

Do not use a verb such as Diff.

Compare

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

Do not use a verb such as Diff.

Compress

Compacts the data of a resource. Pairs with Expand.

Do not use a verb 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. This verb is paired with Mount.

Do not use a verb such as Unlink.

Edit

Modifies existing data by adding or removing content.

Do not use verbs such as Change, Update, or Modify for this action.

Expand

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

Do not use a verb 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 Import.

Do not use verbs such as Extract or Backup.

Group

Arranges or associates one or more resources.

Do not use verbs such as Aggregate, Arrange, Associate, or Correlate.

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 Export.

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.

Limit

Applies constraints to a resource.

Do not use a verb 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. This verb is paired with Dismount.

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 Unpublish.

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

Restore

Sets a resource to a predefined state, such as a state set by Checkpoint. For example, the Restore-Computer cmdlet starts a system restore on the local computer.

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

Save

Preserves data to avoid loss.

Sync

Assures that two or more resources are in the same state.

Do not use verbs such as Coerce, or Match.

Unpublish

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

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 Action Comments

Debug

Examines a resource to diagnose operational problems.

Do not use a verb 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.

Repair

Restores a resource to a usable condition

Do not use verbs such as Fix or Restore.

Resolve

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

Do not use verbs such as Expand or Determine.

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

Approve

Confirms or agrees to the status of a resource or process.

Assert

Affirms the state of a resource.

Do not use a verb such as Certify.

Complete

Concludes an operation.

Confirm

Acknowledges, verifies, or validates the state of a resource or process.

Do not use verbs such as Acknowledge, Agree, Certify, Validate, or Verify.

Deny

Refuses, objects, blocks, or opposes the state of a resource or process.

Do not use verbs such as Block, Object, Refuse, or Reject.

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 Enable.

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 Disable.

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 Uninstall.

Do not a use verb such as Setup.

Invoke

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

Do not use verbs such as Run or Start.

Register

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

Request

Asks for a resource or asks for permissions.

Restart

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

Do not use a verb 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 Suspend.

Start

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

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

Stop

Discontinues an activity. This verb is paired with Start.

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

Submit

Presents a resource for approval.

Do not use a verb such as Post.

Suspend

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

Do not use a verb such as Pause.

Uninstall

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

Unregister

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

Do not use a verb 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 Unblock.

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

Grant

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

Do not use verbs such as Allow or Enable.

Protect

Safeguards a resource from attack or loss. This verb is paired with Unprotect.

Do not use verbs such as Encrypt, Safeguard, or Seal.

Revoke

Specifies an action that does not allow access to a resource. This verb is paired with Grant.

Do not use verbs such as Remove or Disable.

Unblock

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

Do not use verbs such as Clear or Allow.

Unprotect

Removes safeguards from a resource that were added to prevent it from attack or loss. This verb is paired with Protect.

Do not use verbs such as Decrypt or Unseal.

Other Verbs

Windows PowerShell uses the VerbsOther class to define canonical verb names that do not fit into a specific verb name category such as the common, communications, data, lifecycle, or security verb names verbs.

 

Verb Action Comments

Use

Uses or includes a resource to do something.

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 :


Page view tracker