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.



PowerShell 3.0 -PassThru

PowerShell 3 -PassThru Parameter PowerShell PassThru  Version 3.0

PowerShell' s -PassThru parameter has found signficantly more uses in PowerShell 3.0.

In a nutshell -PassThru returns the results of a command that would otherwise be silent.

 ♦

Example 1: Out-GridView -PassThruPowerShell 3.0 Passthru Parameter

Let us take this example where we are using PowerShell 3.0 to display the processes.

Get-Process Out-GridView -PassThru 

The benefit of the -PassThru parameter comes when you select rows with the mouse, and then click OK.  The result is that PowerShell refreshes the output. 

Take the screenshot to the right where I have selected just 5 rows,  dlhost, LogonUI, lsass, MsMpEng and SearchIndex.  When I pressed ' OK' , the result was a display with just those 5 rows.

Result of -PassThru and pressing ' OK'

PowerShell 3.0 Out-GridView Passthru Parameter

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.

Other Examples of PowerShell PassThru

To see the full list of PowerShell PassThru cmdlets try this:

Clear-host
Get-command | Where {$_.parameters.keys -contains "PassThru" `
-and $_.CommandType -contains "Cmdlet"} |
Ft Name, CommandType -AutoSize

Note: Parameters.Keys is the crucial property.

Cmdlets for further study of PowerShell -PassThru

Launching PowerShell v 3.0PowerShell 3.0

This is how to get started from the Metro user interface in Windows 8.

  • From anywhere in the Metro UI, 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' by right-clicking and selecting ' Pin' at the bottom right of the screen.
  • Incidentally, I prefer the GUI (ISE) version to the plain command line Windows PowerShell.
  • 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.

See more of what's new in PowerShell v 3.0 »

Summary of PowerShell 3.0 PassThru

The best way to learn about PowerShell' s -PassThru parameter is by experimenting with examples such as Stop-Process or Out-GridView.

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: