A few weeks ago an Iron Scripter PowerShell challenge was issued that involved playing with words and characters. Remember, the Iron Scripter challenges aren’t intended to create meaningful, production worthy code. They are designed to help you learn PowerShell fundamentals and scripting techniques. This particular challenge was aimed at beginner and intermediate experience levels. I…
Category: Scripting
A PowerShell Network Monitor
I hope you’ve been trying your hand at the scripting challenges being posted on the Iron Scripter website. The challenges are designed for individuals to do on their own to build up their PowerShell scripting skills. A few weeks ago, a challenge was posted to create a network monitoring tool using PowerShell and the Write-Progress…
PowerShell 7 Scripting with the PowerShell ISE
By now, everyone should have gotten the memo that with the move to PowerShell 7, the PowerShell ISE should be considered deprecated. When it comes to PowerShell script and module development for PowerShell 7, the recommended tool is Visual Studio Code. It is free and offers so much more than the PowerShell ISE ever could….
A PowerShell Remote Function Framework
The other day I shared a PowerShell function to query the registry on remote computers to find installed versions of PowerShell. The function leveraged PowerShell remoting with the flexibility of using a computer name with an optional credential or existing PSSessions. The more I thought about it, the more I realized that the structure could…
Get Installed PowerShell Versions
As is the norm for a typical day, I was working on one thing when I was distracted by a shiny rabbit hole (to mix some metaphors). Half a day later I have a new PowerShell function that not only might you find useful, but I think it has some nice scripting features you might…
PowerShell Helper Scripts for Windows Terminal
I’ve spent some time over the last few days getting my Windows Terminal setup in order. Hopefull you saw my recent post about backing up my settings.json file. I’ve also put together a few other simple PowerShell scripts that I use to make Windows Terminal even easier to use and manage. Track Version One of…
Importing Pester Results into PowerShell
Last week, a PowerShell scripting challenge was posted on the Iron Scripter web site. The idea was that when you run a Pester test, you can save the results to a specially formatted XML file. Invoke-Pester C:\scripts\sample.test.ps1 -OutputFile d:\temp\results.xml -OutputFormat JUnitXml I get this result. The challenge was to write a PowerShell command that could…
PowerShell Left-Center-Right
Normally, I’d leave a post like this for a Friday Fun article. But given the situation these days, I thought some of you might like to start your week off with a little fun. And maybe even learn a little PowerShell along the way. If your family is anything like mine, you are hopefully spending…
PSDrives, Shortcuts and Links
I’ll be honest. I’ve never been much of a OneDrive user. Even though I’m a great candidate given that I use multiple systems and need access to a common set of files. But for a number of reasons I’m beginning to make more of a shift to OneDrive. Part of the challenge for me has…
PowerShell 7 Cross-Platform Scripting Tips and Traps
One of the reasons you want to adopt PowerShell 7 on your desktop, is that it can be used cross-platform. Theoretically, you can write a PowerShell script or function that works on Windows, Linux, and Mac. However, this is not without challenges. In some ways, it feels like we are back to the early days…
Creating Linked HTML with PowerShell
Today’s post is about a niche problem or something that maybe you never considered before. And while I will share a finished PowerShell function, you may want to create your own tooling based on the techniques and concepts. The problem begins with a command like this: Get-HotFix -ComputerName $env:computername | Sort-Object Description,InstalledOn -Descending | Select-Object…
Converting Lexical Timespans with PowerShell
I’ve been working on a few scripting projects and the data I’m working with contains lexical timespans. Say what? You have probably seen these things. This is a string like P0DT0H0M47S to represents a timespan. They aren’t difficult for humans to read. This one says “0 days 0 hours 0 minutes 47 seconds”. The format…
Managing the Recycle Bin with PowerShell
A while ago, I posted an Iron Scripter challenge asking you to write some PowerShell code for working with items in the recycle bin. You were asked to calculate how much space the recycle bin is using and then restore a file. If you’d prefer, stop reading this post, check out the challenge and see…
The PowerShell Magic 8 Ball
[I updated this article to reflect minor changes in the code and the release of PowerShell 7. This article was originally published 28 October, 2019]. Last year I shared some PowerShell code on Twitter about this time of year. I have a short script that uses Windows Presentation Foundation (WPF) to create a spooky graphical…
Making Sense of Parallel ForEach-Object in PowerShell 7
By, you’ve most likely heard about the new -parallel parameter with ForEach-Object in the latest preview of PowerShell 7 Personally. I’ve been waiting for this for a long time. I used to only use PowerShell workflows because it offered a way to run commands in parallel. Having this feature as part of the language is…