Guy recommends :
Free SolarWinds
VM Console

Solarwinds VM Console Free Download

Find out which of your VMs are a waste of space and which VMs need more resources.



Show-Command PowerShell 3.0

Show-Command PowerShell 3.0PowerShell Show-Command

Show-Command is a new way for researching the parameters and syntax of other PowerShell cmdlets.  In this tutorial you will see how to filter using 'Modules', then examine the cmdlet properties in a 'Form'.

 ♦

Show-Command Syntax

I see this as a learning tool to compliment Get-Help.  The idea behind Show-Command is to provide a sand box for testing another PowerShell cmdlet; I have chosen to examine the parameters for Get-Process, but you could experiment with any cmdlet.

# Windows PowerShell 3.0 New Cmdlet
Show-Command Get-Process

PowerShell Show-Command ParametersNote 1: The rhythm is:
Show-Command cmdlet2.

Results of Show-Command
The idea is that you can test various parameters, such as Id, or computer name.

Note 2: Observe how you can 'Run' the experiment, or if that button is greyed out, you can 'Copy', then paste from the form into the PowerShell GUI.

Note 3: It's worth running Show-Command just to remind oneself of the 'Common Parameters'.

Note 4: If you are experimenting for real I recommend opening the corresponding interface, in this case Task Manager; then I compare the Show-Command form with the Task Manager Process tab.

Show-Command with Get-ChildItemShow-Command Parameters

Here is another example which shows how you can learn more about the parameters of a cmdlet, this time it's gci (Get-ChildItem).

# PowerShell 3.0 Script
Show-Command Get-ChildItem

Note 5: See from the screenshot how the PowerShell Show-Command helps reveal parameters such as -recurse and -force.  If you do this for real scroll up (or down) to see more options.

Note 6: Remember that you have the option to 'Run', or 'Copy'.  If you choose copy then I suggest you open another 'New' script page and paste, that's the easiest way to see what Show-Command has produced.

The above example would paste: Get-ChildItem -Path C:\CP -Recurse 
(Assuming you added a Path parameter in addition to the ticking the Recurse box).  For more information see the PowerShell 3.0 ISE.

Guy Recommends: WMI Monitor and It's Free!Solarwinds Free WMI Monitor

Windows Management Instrumentation (WMI) is one of the hidden treasures of Microsoft operating systems.  Fortunately, SolarWinds have created a Free WMI Monitor so that you can discover these gems of performance information, and thus improve your PowerShell scripts.  Take the guess work out of which WMI counters to use when scripting the operating system, Active Directory or Exchange Server.

Download your free copy of WMI Monitor

How to Launch Windows PowerShell ISEPowerShell V 3.0

Here is an easy way to get started from the Microsoft Metro UI.

  • From anywhere in the Metro UI if you press the 'p' key, you should see a list of the programs and Apps beginning with 'p'.
  • At this point you could 'Pin' the 'Windows PowerShell ISE' to the main screen by right-clicking and selecting 'Pin' at the bottom right of the screen.
  • I like to drag the PowerShell ISE tile to the left of my screen because it's one of the most important Windows 8 Tiles that use.
  • To install Windows 8 with PowerShell 3.0 see here.

Auto-Complete In PowerShell 3.0?

Auto-Complete is a nifty command to learn more about Windows PowerShell.  As you begin to type a cmdlet, say 'Show-' you see a pick-list of likely nouns to append to your verb.PowerShell ISE Auto-Complete

Microsoft also provide a useful way of grouping cmdlets:

Microsoft Windows 8 PowerShell

Investigate Three More PowerShell Techniques

Guy Recommends:  SolarWinds' Free Bulk Import ToolFree Download of Solarwinds  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 to import the users.  Optionally, you can provide the name of the OU where the new accounts will be born.

There are also two bonus tools in this free download, and all 3 have been approved by Microsoft:

  1. Bulk-import new users into Active Directory.
  2. Seek and zap unwanted user accounts.
  3. Find inactive computers.

Download your FREE bulk import tool.

This is How to Discover More PowerShell 3.0 Cmdlets

Note how this PowerShell script sorts the 'CommandType' in descending order, and the 'Name' in ascending order.

# Short PowerShell 3.0 Script
Clear-Host
$PSSC = Get-Command | `
Where-object {$_.CommandType -eq 'Alias' -or $_.CommandType -eq 'Cmdlet'}
$PSSC | Sort-Object -property `
@{Expression="CommandType";Descending=$true}, `
@{Expression="Name";Descending=$false} | FT CommandType, Name -auto

Note 7: Much to my surprise, I discovered these two cmdlets: Show-EventLog and Show-ControlPanelItem.

Summary of PowerShell 3.0's Show-Command

This tutorial explains how to employ Show-Command, which is one of PowerShell 3.0's new cmdlets.  Beginners may find the results a little perplexing and advanced PowerShell users may have better ways of extracting the same information; but for intermediates, I think that PowerShell's Show-Command is ideal for discovering more about other cmdlets.

If you like this page then please share it with your friends

 


See more Microsoft PowerShell v 3.0

PowerShell 3.0  • What's New in PowerShell 3.0  • PowerShell 3.0 Foreach-Object

PowerShell Show-Command  • Out-GridView -PassThru  • PowerShell Ordered Hash Tables

PowerShell Home  • PowerShell 3.0 Get-ChildItem  • PowerShell 3 -notIn  • PowerShell 3.0 Where

 *


Custom Search

Site Home

Guy Recommends: SolarWinds Free IP SLA MonitorSolarwinds IP Sla Monitor

SolarWinds IP SLA Monitor offers so much more than just uncovering network bottlenecks, the real joy is learning about router traffic.

To find out what's happening on the network between your computers and their routers, download your free copy of the of IP SLA Monitor.

Article by: Guy Thomas Copyright © 1999-2012 Computer Performance LTD All rights reserved.

Please report a broken link, or an error to: