It's pretty easy to send PowerShell results to Excel and display them nicely as a spreadsheet. Actually, here's a simple function called Out-ExcelReport . Pipe anything to it, and it shows up as an excel sheet (provided you have indeed installed excel beforehand): function Out-ExcelReport { param...
A few days ago I saw on question, I think on Facebook, about using PowerShell to find the next available drive letter that could be used for mapping a network drive. Before I show you my approach, let me state … Continue reading → Read More...
With Valentine’s Day just around the corner, I thought I should help you out with your gift giving. Remember those bags of candy with the cute sayings like “Be Mine”? Here’s how you can create a “bag” of them using...
Last week I posted a PowerShell snippet on Twitter. My original post piped an array of integers as [CHAR] type using an OFS. Don’t worry about that. As many people reminded me, it is much easier to use the -Join … Continue reading →...
In a post yesterday, I looked at telling the difference between a scalar and arrays. The difference matters when working with PowerShell – a scalar has properties and methods, while an array has members that have properties and methods. You can directly...
Over on Hal Rotettenberg’s blog ( TechProsaic ), he recently posted an interesting article about how to tell if an object in PowerShell is an array or a scalar. His solution was to use the Get-Type method, and to look for the BaseType property of the...
Recently in a workshop, we wanted to create a little PowerShell script to return nine unique random numbers. Since all participants were experienced VBScript scripters, they quickly came up with a solution. This solution grew bigger and bigger and more complicated with every new detail ("the random...