If you don't like what PowerShell commands return to you, send it on to Select-Object ! Select-Object is one of the most important cmdlets because it allows you to pick the columns (properties) you want to see. Check out these lines: PS> Dir $env:windir PS> Dir $env:windir | Select-Object ...
Recently I was tracking down a bug in script for a client. The problem turned out to be a simple typo. I could have easily avoided that by using Set-StrictMode, which I do now, but that’s not what this is … Continue reading → Read More...
Here’s another concept I know I’ve written about in the past but that needed an update. A common technique I use when exploring and discovering objects is to pipe the object to Select-Object specifying all properties, get-service spooler |...
Recently I responded to an email from a student seeking clarification about the difference between ByValue and ByProperty when it comes to parameter binding. This is what makes pipelined expressions work in Windows PowerShell. When you look at cmdlet...
One of my nuisance issues when using WMI with Windows PowerShell, is that when looking at all properties I have to wade though many that have no value. I’d prefer to only view properties that have a populated value. Here’s … Continue...
Sometimes, the true information you are after is burried deep inside object models . For example, when you manage virtual machines with the VMWare cmdlets, Get-VM will get you only very sparse pieces of information. The real goodies are stored inside of subproperties (which was true for the MPEG3 module...
A lot of data these days is wrapped as XML, and up until now, handling XML data wasn't a piece of cake. PowerShell makes handling XML a lot easier. This is the first part of a little series about XML and PowerShell. We start with accessing XML documents and reading data. Getting XML Data Let's...