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…
Tag: PowerShell
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…
Friday Fun: A Long Time Ago in a PowerShell Universe Far, Far Away
With the upcoming release of the next Star Wars movie, I thought I would revisit my PowerShell script that generates your Star Wars universe name. Sure, it is contrived and completely impractical, but I’m betting you are curious nonetheless. My previous version as a simple script with hard coded values which meant you had to…
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…
Extending PowerShell with Custom Property Sets
If you’ve been following along on the blog recently you’ve read about my use of PowerShell type extensions. This is a way of adding new properties to things I use all the time. The goal is to save typing and get what I need with minimal effort. You can also take this a step further…
Extending Hyper-V with PowerShell
Lately I’ve been writing about my use of PowerShell type extensions as a way to get more done quickly. Or at least give me the information I want with minimal effort. I use Hyper-V a great deal and the Hyper-V cmdlets are invaluable. And while a command like Get-VM provides a lot of information, 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.
Adding Efficiency with PowerShell Type Extensions
The other day I posted an article about custom properties which wrapped up with a look at Update-TypeData. The goal is not so much to make your scripts or modules easier to use, but rather to increase efficiency at the command prompt. When running commands interactively I want to get the information I need as…
Are You My Type?
I am always stressing that PowerShell is all about the objects. If you keep this in mind, PowerShell is pretty easy to use. Get a bunch of things, and select the details that you want to see or work with. Out of the box PowerShell gives you some very rich objects to work with from…
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…
PowerShell Pop Quiz
I’m always looking for ways to help teach PowerShell and the other day I thought why not have PowerShell teach you itself? I have created a PowerShell script that dynamically generates a quiz on cmdlets and functions installed on your computer. In short the quiz question shows you a command synopsis and then presents a…
Get Git with PowerShell
If you are creating PowerShell scripts, tools or modules today, you are most likely using Git. What? You’re not? Is it because you haven’t gotten around to installing it? I have some “quick and dirty” PowerShell hacks to help you out on Windows systems. Linux boys and girls already know what to do.
Enhancing PSVersionTable
Not too long ago I posted a PowerShell function that could provide detail abut the PowerShell engine driving your current PowerShell session. I like having a function that writes an object to the pipeline, can take parameters and offer help documentation. But there’s an alternative approach you could also take.