Introduction to Windows PowerShell Verbs for Scripting
In Windows PowerShell, verbs always come first in the Verb-Noun command pair. Get-Noun, set-value, remove-Item. Only 50 verbs perform 80% of PowerShell tasks. So far I have only used about 25 verbs.
Experiment With Get-Verb
Experiment with these commands, just substitute the noun that you are interested in:
Get-Verb
Get-Verb | Get-Member
Special note, the pipeline symbol displays as ¦ in PowerShell, but as | in notepad.
List of Windows PowerShell Verbs
# To get a list of verbs for PowerShell v 2.0 try this
Get-Command -verb
Add (add-Content, works like append)
Clear (clear-Variable)
(Delete* – there is no delete in PowerShell, instead see remove)
Expand
Export
Format (format-List or Format-Table)
Get (This is the default verb, not always necessary, often assumed)
Group (group-Object often abbreviated to plain group)
Import
Measure (measure-Object)
Move
New (new-Object, opens up a whole world of com or net objects)
Out (out-File, also out-Printer, even out-Host)
Pop
Push
Read (read-Host is a method of obtaining console input)
Remove * (remove-Item. PowerShell’s way of deleting)
Resume (Service)
Restart (Service)
Set (set-Location, like cmd’s cd) (set-executionpolicy Unrestricted)
Sort (Strictly speaking Sort-Object)
Start (start-Service)
Stop (stop-Service)
Write (write-Host, also write-Output)
Guy Recommends: SolarWinds’ Free Bulk Import Tool
Import users from a spreadsheet. Just provide a list of the users with their fields in the top row, and save as .csv file. Then launch this FREE utility and match your fields with AD’s attributes, click and import the users.
Optionally, you can provide the name of the OU where the new accounts will be born. Download your FREE bulk import tool.
If you need more comprehensive application analysis software,
Download a free trial of SAM (Server & Application Monitor)
Summary of PowerShell Verbs
Never miss a chance to learn a new PowerShell verb, actually there are not that many to master, if you regularly use 40 then you are an advanced programmer. ‘Get’ is the default verb, probably the next commonest is: ‘set’. The construction begins with a verb then a hyphen, finally the Verb or object for example, Get-Process.
If you like this page then please share it with your friends
See more PowerShell examples for syntax advice
• PowerShell Tutorials • Syntax • Get-Verb • PowerShell Nouns • Get-Credential
• PowerShell -as • Comparison operators • Conditional operators • Real-time Bandwidth Monitor
• Get-Date • Quotes • Windows PowerShell • PowerShell Version Check • Get-Member
Please email me if you have a better example script. Also please report any factual mistakes, grammatical errors or broken links, I will be happy to correct the fault.