The other day I shared part of my solution to an Iron Scripter challenge to write a generic function to report on the age of an object. The idea being that you could pipe any type of object to the function and get a result. And because I can’t help myself, I went a bit…
Tag: PowerShell
Solving the PowerShell Object Age Challenge – Part 1
A few weeks ago, the Iron Scripter site posted an interesting challenge about writing a generic function to get the age of objects. Many things that we deal with in PowerShell have an “age” such as files, processes or even AD groups and users. I think this is an especially useful exercise because it forces…
Show ANSI Samples
Earlier this week I did a live session for the PSPowerHour. I talked about ways to dress up your PowerShell work and console sessions. One of things I talked about was using ANSI escape sequences to add some color. What I realized was that I was constantly referring to my reference source at https://en.wikipedia.org/wiki/ANSI_escape_code. That’s…
Solving the PowerShell Counting Challenge
A few weeks ago, an Iron Scripter PowerShell scripting challenge was posted. As with all of these challenges, the process is more important than the end result. How you figure out a solution is how you develop as a PowerShell professional. A few people have already shared their work. Today, I thought I’d share mine….
PowerShell Word Play
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…
Friday Fun with PowerShell and ANSI
Ever since PowerShell 7 came along, I’ve been having a lot of fun exploring what I can do with ANSI color escape sequences. And actually, even in Windows PowerShell you can use them. Although you need to use a different escape character. Run Get-PSReadlineOption to see what I’m talking about. Today I have 2 quick…
Open Windows Terminal PowerShell Split Paned
The other night I presented for the Mississippi PowerShell User Group on how to get started using Windows Terminal. This has been my go-to PowerShell console for quite a while. I use Windows Terminal for everything. During the talk a question came up about starting a session with split panes. This is a very cool…
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…
A PowerShell Windows Terminal Toolbox
Last week I shared some PowerShell code I had been using to manage different aspects of Windows Terminal. I also had posted a script to backup my Windows Terminal settings file. With all that code, plus other ideas brewing, it only made sense to bundle everything together into a PowerShell module. The module, WTToolBox should…
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…
Backing Up Windows Terminal Settings with PowerShell
I’ve been a big fan of Windows Terminal since the very beginning. In fact, I’ve been using it for so long that I’ve been moving along profile settings that have long since changed. I didn’t bother to update my settings. Part of the challenge is that the app will update in the background and I…
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…