Tag Archives: objects

Using Types with Imported CSV Data in PowerShell

The Import-CSV cmdlet in PowerShell is incredibly useful. You can take any CSV file and pump objects to the pipeline. The cmdlet uses the CSV header as properties for the custom object. PS S:\> import-csv .\testdata.csv Date    : 1/18/2012 … Continue reading

Posted in PowerShell v2.0, Scripting | Tagged , , , , , | 2 Comments

Friday Fun What’s My Variable

I use scriptblocks quite a bit in my PowerShell work, often saved as variables. These are handy for commands you want to run again, but don’t necessarily need to turn into permanent functions. $freec={(get-wmiobject win32_logicaldisk -filter "deviceid=’c:’" -property Freespace).FreeSpace/1mb} Now … Continue reading

Posted in Friday Fun, PowerShell | Tagged , , , , , | Leave a comment

Friday Fun – Get Ranked Object

Earlier this week on Google Plus, Hal Rottenberg posted a PowerShell idea he had. His goal was to identify a group of objects that would be statistically significant. For example, given a collection of files, group the files by size … Continue reading

Posted in PowerShell, Scripting | Tagged , , , , | Leave a comment

Friday Fun – Get Number Object

You most likely know that I’m all about the object and the PowerShell pipeline. Everything in PowerShell is an object. Pipe something to Get-Member and you can discover all of the object’s properties and methods (ie its members). Some objects, … Continue reading

Posted in Friday Fun, PowerShell, Scripting | Tagged , , , , , | Leave a comment

Turning IPConfig DNSCache into PowerShell

Lately I’ve been writing about techniques to turn command line tools into PowerShell tools. Although I suppose the more accurate description is turning command line output into PowerShell pipelined output. The goal is to run a command line tool and … Continue reading

Posted in CommandLine, PowerShell, PowerShell v2.0 | Tagged , , , , | Leave a comment