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 type of PowerShell-based tool where you would like something other than a console-based prompt. I thought I’d give a sneak peak at a function I will be adding to my PSScriptTools module that creates a graphical inputbox using WPF.

Continue reading

A PowerShell Countdown Timer

The other day, during one of the monthly #PSTweetChat sessions, I exchanged some tweets with Joshua King. We got on the topic of countdown timers and he shared some code he uses for his YouTube channel. The command creates a progress bar and counts down, displaying some humorous messages along the way. There’s absolutely nothing wrong with his solution but I can’t help myself and am always looking to see what else it can do.  So after a bit of time with it, I came up with a version I call Start-PSCountdown. This is something I expect to be able to use in my PowerShell training classes and conferences.

Continue reading

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. if you’ve written informative Verbose messaging you should be able to figure out the problem. Part of the information might include metadata about the person running the command and their environment. To simply things, I’ve created an easy to use function called Get-PSWho.

Continue reading

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 have been working on a module to simplify this even further. The module is still in beta so I’m hoping some of you will kick it around before I publish it to the PowerShell Gallery.

Continue reading

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 might want to see something else in my browser. I had been pasting the file path and pasting it into the browser, but of course realized I should get smart about this and write a PowerShell function to make this easier. Thus was born Out-Browser. Although it proved a bit trickier than I expected because the registry was involved.

Continue reading