Last year I wrote a sidebar for the Scripting Guy, Ed Wilson and an update to his PowerShell Best Practices book. I wrote a script using the new parser in PowerShell 3.0 to that would analyze a script and prepare a report showing what commands it would run, necessary parameters, and anything that might pose…
Category: PowerShell
Training for the Future
I just finished a week of PowerShell training in Phoenix. It was a terrific class that uses the Learn PowerShell 3 in a Month of Lunches book as the course material. I will be back in Phoenix next month to teach the class and I’m also on the books for the course in March. If…
Friday Fun: Does Anyone Really Know What Time It Is?
In PowerShell it is brain-dead easy to get the date and time with Get-Date. If you look through articles I’ve posted you’ll find plenty of examples using Get-Date and the [DateTime] object. But now that we’re getting ready for a new year, I thought you might be planning ahead and might want a few shortcuts…
Friday Fun: A Christmas Present for You
Over the years a number of people in the PowerShell community have shared Christmas and holiday related items. I’ve collected them and in some cases tweaked a little bit. This year I decided to wrap them all up in a module for you. This will work in PowerShell 2.0 and later. #requires -version 2.0 <#…
Friday the 13th PowerShell Fun
Well here are once again and another Friday the 13th. I love these days because I feel challenged to come up with 13 PowerShell related tidbits which I hope you’ll find fun and maybe even a little educational. Today’s collection should work primarily on PowerShell 3.0. Most items might also work on PowerShell 2.0. A…
Friday Fun: Theme Me Up!
When PowerShell 3.0 came out, one of the compelling features was a re-vamped PowerShell ISE. Options in the ISE included the ability to fine-tune and customize the appearance including items like font, token colors, and screen colors. If I recall correctly, in PowerShell 2.0, if you wanted to customize the appearance, you needed to add…
Get PowerShell Version with WMI
With the release of PowerShell 4.0, it is possible you might end up with a mix of systems in your environment. I know I do because I do a lot of writing, testing and development that requires multiple versions in my test network. Recently I was doing some Group Policy work when I thought about…
More PowerShell Trace Window Fun
On my last Friday Fun, I posted an article about using Internet Explorer as a trace window. The idea was to put debug or trace messages in a separate application. I received a comment on the post that suggested I could do a similar thing using the Debug View utility from Sysinternals. This application is…
Managing Local Admin with PowerShell
Years ago when I was deep into VBScript and HTAs, I wrote a tool called PWDMan. It was an HTA that processed a list of computers and returned password age information for the local administrator account. It was also capable of setting a new account password. Apparently this is still a common task because I’ll…
Runspaces, Remoting and Workflow, Oh My!
The other day on Twitter I saw a message about new script in the Microsoft Script Center on getting remote event logs with WMI. So I took a look at the script. If you take a minute to look at the script you’ll quickly realize this is not a script for beginners. My initial thought…
Resolving SIDs with WMI, WSMAN and PowerShell
In the world of Windows, an account SID can be a very enigmatic thing. Who is S-1-5-21-2250542124-3280448597-2353175939-1019? Fortunately, many applications, such as the event log viewer resolve the SID to an account name. The downside, is that when you are accessing that same type of information from PowerShell, you end up with the “raw’ SID….
Friday Fun: Pi-romania
I was doing some benchmarks the other day, and one of the tests was a calculation of pi using a particular algorithm. I found that quite interesting and naturally this made me curious if I could do the same calculation in PowerShell. Of course, if all you need is the value of pi, that is…
Friday Fun: Out-ConditionalColor
Last week I posted a Friday Fun article on parsing results from Invoke-Webrequest and displaying matching strings in color so that the book titles I’m interested in stand out. But the more I thought about it I realized I should take this a step further. The problem with Write-Host is that it doesn’t write anything…
Friday Fun: Get Friday the 13th
I thought it might be fun today to use PowerShell to discover all the Friday the 13ths in a given year. So I put together a simple PowerShell one-liner. To make it flexible I’ll use a variable for the year, using the current year as my value. $year = (Get-date).Year Because there can only be…
PowerShell 4.0 A First Look
My first look at PowerShell 4.0 is now online at 4Sysops.com. A few interesting bits but with 3.0 still gaining traction I’m wondering how much people will actually adopt 4.0. It seems to me that some of the biggest features like Desired State Configuration will require Windows Server 2012 on the back end and it…