I have no idea what possessed me, but the other day I came across an older script that uses PowerShell to create an HTML report showing drive utilization for a group of computers. The utilization is displayed using a color gradient from green to red to provide a visual reference. As I looked at the…
Category: Scripting
PowerShell Calendaring Revisited
Early this week, I came across an old snippet of code in my scripts folder, originally published by Lee Holmes. It was an old script, from 2008, on using PowerShell to display a calendar with out of office information. I seem to recall that I had been trying to do something similar — display a…
Searching for a CIM/WMI Class with PowerShell
I got a question on Twitter about an older function I has posted to get antivirus information via WMI. The function continues to work fine with Windows 10, although there’s always room for improvement. However, the question was that the function did not seem to work when querying a server running Windows Server 2016 or…
Extending VSCode with PowerShell
Last year I made a conscious decision to jump into VS Code as my primary PowerShell development tool. I had spent years tweaking and customizing the PowerShell ISE so I was a little concerned about the transition. But I knew the only way I’d master VS Code (and I still have a long way to…
Extending PowerShell DateTime Objects
I’ve been experimenting more with my PSTypeExtensionTools module, finding more objects to enhance. You can check out the project on Github and install the module from the PowerShell Gallery. My current fun has been with the DateTime object – specifically converting a value into another culture. Apparently those of us in North America don’t know…
New PowerShell Projects Published
Last week I published a few of the recent PowerShell modules I’ve been working on to the PowerShell Gallery. These projects had been in a beta phase while I worked out some last minute features. I was also waiting to see if there were any issues reported by you that I might need to address….
A PowerShell Input Tool
In PowerShell, the primary means to get interactive input from a user is with the Read-Host cmdlet. There’s nothing wrong with it but sometimes if you are using it in a graphical tool like the PowerShell ISE or VS Code you may not realize you are being prompted. Or perhaps you are building some other…
Who is Running Your PowerShell Script?
I’ve often talked about the benefit of including Verbose output in your PowerShell scripts and functions from the very beginning. This is especially helpful when someone else is running your command but encounters a problem. You can have them start a transcript, run your command with –Verbose, close the transcript and send it to you….
A PowerShell Module for your Type Extensions
If you’ve been following this blog recently, you’ve read about my fun with PowerShell type extensions. This technique lets you make PowerShell give you the information you want without a lot of work on your part. Well, there is some work but you only have to do it once. To make it even easier, I…
Sending Files to Your Browser with PowerShell
Over the course of the last year I’ve been using markdown files much more, especially as part of the Platyps module. Even though I have a markdown editor and I can also preview files in VS Code, sometimes I want to see the file in my browser which has a markdown viewer plugin. Or I…
Managing the PSReadline History File
It has taken some discipline but I have finally gotten the hang of using the command history file maintained by PSReadline. Even though Set-PSReadlineOption has a few options on how to use this file, in my experience I have felt the need to handle a few things on my own. Here’s my take.
PowerShell Reminders now in Beta
For awhile now I’ve been working on a PowerShell project that I use every day. I am always in a PowerShell prompt and because I always seem to have little things like phone calls or family events that I need to keep track of, I wrote a “tickler” system. The events are stored in a…
Throwing the Kitchen Sink at PowerShell
The other day I was watching a good intro video from Shane Young on getting started with PowerShell profiles. I use profile scripts extensively, and they can be extremely useful in configuring your PowerShell experience. One element you could add to your profile is a customized PowerShell prompt. Microsoft provides one by default. It creates…
Who’s Driving this Shell?
Microsoft has been busy with the next iteration of PowerShell. As you should already know, this version will run cross-platform. The executable, or engine, is naturally different than what you are used to with Windows PowerShell. As I was trying out the latest PowerShell beta, I needed to identify the path to the current PowerShell…
PowerShell Summit 2017 Demo Files
During the recent PowerShell+DevOps Global Summit I had two primary presentations, that is, traditional sessions with slides and demos. My other sessions were panels which means if you weren’t in the room you missed out on some great content and interaction. Anyway….my main sessions were on creating class-based PowerShell tools and using Nano server in…