Windows PowerShell

Guy recommends:
Free config generator

Solarwinds Config Generator

This CG will put you in charge of controlling changes to network routers and other SNMP devices.

Download your free Config Generator



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 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)

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

Guy Recommends:  A Free Trial of the Orion Network Performance Monitor (NPM) v10Review of Orion NPM v10

Solarwinds' Orion performance monitor will help you discover what's happening on your network.  Also this utility will guide you through troubleshooting; the dashboard will indicate whether the root cause is a broken link, faulty equipment or resource overload.  Because it produces network-centric views, the NPM is intuitive to navigate, and you can export the results to Microsoft Visio.

Perhaps Orion's best feature is the way it suggests solutions.  Moreover, if problems arise out of the blue, then you can configure Orion NPM v10 to notify members of your team what's changed and how to fix it.

If you are interested in troubleshooting, and creating network maps, then I recommend that you take advantage of Solarwinds' offer and download a free trial of Orion's Network Performance 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.

See more PowerShell examples for syntax advice

PowerShell Tutorials  • Syntax  • Get-Verb  • PowerShell Nouns  • Get-Member  • Get-Credential

PowerShell -as  • Comparison operators  • Conditional operators  • Get-Date  • Quotes

Please write in 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.

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

WebThis Site

Guy Recommends: WMI Monitor and Its Free!Solarwinds WMI Monitor

Windows Management Instrumentation (WMI) is one of the hidden treasures of Microsoft operating systems.

 Fortunately, Solarwinds have created the WMI Monitor so that you can examine these gems of performance information for free.  Take the guess work out of which WMI counters to use for applications like Microsoft Active Directory, SQL or Exchange Server.

Download your free copy of WMI Monitor

 

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

Please report a broken link, or an error.