Windows PowerShell


Windows PowerShell - Verbs for Scripting

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

Experiment with these commands, just substitute the noun that you are interested in:

get-verb  (get-service)
get-verb | get-Member  (get-service | 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)

Nouns - See the noun half of the verb-noun pair

Solarwinds LANSurveyorGuy Recommends: A Free tool from SolarWinds: Config Generator

Config Generator (CG) is a free tool, which puts you in charge of controlling changes to network routers and other SNMP devices.  Boost your network performance by activating network device features you've already paid for.

Guy says that for newbies the biggest benefit of this free tool is that it will provide the impetus for you to learn more about configuring the SNMP service with its 'Traps' and 'Communities'.  This is a brand new free utility which Solarwinds released on January 26th 2010.

Download your free copy of the Config Generator

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.

See more Microsoft PowerShell tutorials

PShell Home  • Introduction  • Dreams  • 3 Key Commands  • Cmdlet scripts  • Real life tasks

Remote PowerShell  • -Online  • WinRm and WSMan  • Invoke-Command  • Jobs  -asJob

Please write in if you see errors of any kind.  Please report any factual mistakes, grammatical errors or broken links, I will be happy to not only to correct the fault, but also to give you credit.

Download my ebook:Getting Started with PowerShell
Getting Started with PowerShell - only $9.25

You get 36 topics organized into these 3 sections:
   1) Getting Started
   2) Real-life tasks
   3) Examples of Syntax.

In addition to the ebook, you get a PDF version of this  Introduction to PowerShell ebook  It runs to 120 pages of A4.

 *


Google

Web  This website

Review of Orion NPMGuy Recommends: Orion's NPM - Network Performance Monitor

Orion's performance monitor is designed for detecting network outages. A network-centric view make it easy to see what's working, and what needs your attention.

This utility guides you through troubleshooting by indicating whether the root cause is faulty equipment or resource overload.

Download a free trial of the Network Performance Monitor

 

Home Copyright © 1999-2010 Computer Performance LTD All rights reserved

Please report a broken link, or an error.