October 2025 PowerShell Potluck
In this issue:
- Using Regex in PowerShell
- PSMiniCon Videos
- FancyClearHost
- More Fun with Colors
- PowerShell Summit 2026
- A New Scripting Challenge
- Summary
Time to wrap up another month with a potluck of PowerShell goodies. This is the one time where what I publish is more like a traditional newsletter. The rest of the month I am trying to provide in-depth technical content that teaches, enlightens, and entertains. If you are not a premium subscriber, I hope you will consider upgrading your subscription. Yearly and monthly subscriptions are available, which give you full access to all content, and you can cancel at any time. Use the subscription links in the footer of this email. And in case you didn't realize it, all the content is archived and available at https://buttondown.com/behind-the-powershell-pipeline/archive/. Note that some of the older content was migrated from Substack so formatting may be a little off.
Using Regex in PowerShell
First up is a YouTube video from PowerShell MVP and a highly regarded member of the PowerShell community, Steven Judd. This video is part of the PowerShell Wednesday series I'v mentioned before. In this video, Steven dives into regular expressions and PowerShell. He starts with simple matching and moves on to complex text parsing. I will admit that learning regular expressions can be a bit daunting at first, but think how hard it was to get started with PowerShell and look what you know now! Regular expressions is a powerful tool that you need to know and can only make you a better PowerShell user and scripter.
The video is just a little over an hour long so you can probably squeeze it in during a lunch break. Take a look at https://www.youtube.com/watch?v=65kvR0mVu6E and start your regex journey.
PSMiniCon Videos
While we are on the subject of videos, earlier this month was the PSConfEU Minicon. This was a free, online 1-day event with the type of content you get from the PowerShell Summit and PSConfEU. I did a presentation on "The Human Side of PowerShell" scripting. This is the session I was supposed to give in Sweden this summer before my travel plans blew up.
Recordings from the Minicon are being published to YouTube. More videos will be added as they are processed, but you can already find some great content there. I'd love to hear what you found interesting or helpful.
FancyClearHost
If you spend a lot of your day working from a PowerShell prompt, you probably use the Clear-Host cmdlet (or its alias cls) to clear the screen from time to time. But what if you could make it a little more interesting? There's no reason PowerShell has to be boring!
For a little pizzazz, take a look at the FancyClearHost PowerShell module. You can install it from the PowerShell Gallery.
PS C:\> Find-PSResource FancyClearHost
Name Version Prerelease Repository Description
---- ------- ---------- ---------- -----------
FancyClearHost 0.1.0 PSGallery Clears your PowerShell host in a f…
Even though the version number appears to be low, don't be misled. I think the module is pretty much feature complete. The module has a single command.
PS C:\> Get-Command -Module FancyClearHost | Select Name
Name
----
Clear-HostFancily
This command is an alternative to Clear-Host. Now for the fun. The function will clear the screen, but use a variety of animations which you can specify with the -Mode parameter.
- Bricks
- Falling
- Flipping
You really have to see these for yourself in action. If the animation feels too slow or fast, you can adjust the speed with the -Speed parameter. Or you can press Q to quit the animation early.
In my profile, I set default parameter values.
$PSDefaultParameterValues['Clear-HostFancily:Mode'] = 'Falling'
$PSDefaultParameterValues['Clear-HostFancily:Speed'] = '2.75'
You could re-map the cls alias to use this function instead of Clear-Host.
Set-Alias -Name cls -Value Clear-HostFancily
Or if you don't want to lose the original Clear-Host, you could create a new alias.
Set-Alias -Name cl -Value Clear-HostFancily
There isn't any production value to this module, but it is a fun way to liven up your PowerShell console experience. I hope you'll give it a try!
More Fun with Colors
Earlier this month, I wrote a few issues about using colors in PowerShell. One topic I didn't dive into was the 256-color ANSI palette. This is a color mode supported by many terminal emulators, including the Windows Terminal. If you are using the Windows Terminal, you can take advantage of this color mode in your PowerShell sessions. The 256-color ANSI index, also known as the 8-bit color mode, extends the basic 16-color palette to provide a much wider range of colors.
The 256-color palette is divided into four main sections:
- Colors 0 to 7 represent the standard ANSI colors (black, red, green, yellow, blue, magenta, cyan, white).
- Colors 8 to 15 are the "high intensity" or "bright" versions of the standard colors, often used to simulate bold text.
- Colors 16 to 231 form a 6x6x6 RGB color cube, providing 216 distinct colors.
- Colors 232 to 255 represent 24 grayscale shades, ranging from dark to light.
There are formulas for converting values which I've combined into a PowerShell function.
function Get-256ColorRGB {
#Convert 256-color ANSI index to RGB values
[cmdletbinding()]
[OutputType('PSCustomObject')]
param(
[Parameter(Mandatory, ValueFromPipeline)]
[ValidateRange(0, 255)]
[int]$ColorIndex
)
process {
# Colors 0-15: Standard colors
if ($ColorIndex -le 15) {
$StandardRGB = @(
@{R = 0; G = 0; B = 0 }, # 0: Black
@{R = 128; G = 0; B = 0 }, # 1: Dark Red
@{R = 0; G = 128; B = 0 }, # 2: Dark Green
@{R = 128; G = 128; B = 0 }, # 3: Dark Yellow
@{R = 0; G = 0; B = 128 }, # 4: Dark Blue
@{R = 128; G = 0; B = 128 }, # 5: Dark Magenta
@{R = 0; G = 128; B = 128 }, # 6: Dark Cyan
@{R = 192; G = 192; B = 192 }, # 7: Light Gray
@{R = 128; G = 128; B = 128 }, # 8: Dark Gray
@{R = 255; G = 0; B = 0 }, # 9: Red
@{R = 0; G = 255; B = 0 }, # 10: Green
@{R = 255; G = 255; B = 0 }, # 11: Yellow
@{R = 0; G = 0; B = 255 }, # 12: Blue
@{R = 255; G = 0; B = 255 }, # 13: Magenta
@{R = 0; G = 255; B = 255 }, # 14: Cyan
@{R = 255; G = 255; B = 255 } # 15: White
)
[PSCustomObject]$StandardRGB[$ColorIndex]
}
# Colors 16-231: 6x6x6 color cube
elseif ($ColorIndex -le 231) {
$index = $ColorIndex - 16
$r = [math]::Floor($index / 36)
$g = [math]::Floor(($index % 36) / 6)
$b = $index % 6
# Convert 0-5 range to 0-255 range
$rValue = if ($r -eq 0) { 0 } else { 55 + $r * 40 }
$gValue = if ($g -eq 0) { 0 } else { 55 + $g * 40 }
$bValue = if ($b -eq 0) { 0 } else { 55 + $b * 40 }
[PSCustomObject]@{R = $rValue; G = $gValue; B = $bValue }
}
# Colors 232-255: Grayscale
else {
$gray = 8 + ($ColorIndex - 232) * 10
[PSCustomObject]@{R = $gray; G = $gray; B = $gray }
}
}
}
I'm assuming you have obtained a 256-color value from somewhere that you want to convert.
PS C:\> Get-256ColorRGB 123
R G B
- - -
135.00 255.00 255
To see what this looks like, you can use this revised version of the Convert-RGBtoAnsi function from earlier this month.
function Convert-RGBtoAnsi {
#This will write an opening ANSI escape sequence to the pipeline
[cmdletbinding()]
[Alias('crgb')]
[OutputType('String')]
param(
[parameter(Position = 0, ValueFromPipelineByPropertyName)]
[Alias('R')]
[int]$Red,
[parameter(Position = 1, ValueFromPipelineByPropertyName)]
[Alias('G')]
[int]$Green,
[parameter(Position = 2, ValueFromPipelineByPropertyName)]
[Alias('B')]
[int]$Blue,
[switch]$Background,
[Parameter(HelpMessage = 'Display the ANSI string unformatted')]
[switch]$AsString
)
process {
if ($Background) {
$out = $PSStyle.Background.FromRgb($Red, $Green, $Blue)
}
else {
$out = $PSStyle.Foreground.FromRgb($Red, $Green, $Blue)
}
if ($AsString) {
$out.Replace("`e", "``e")
}
else {
$out
}
}
}
I can see the converted ANSI escape sequence.
PS C:\> Get-256ColorRGB 123 | Convert-RGBtoAnsi -AsString
`e[38;2;135;255;255m
Here's how I might use this to display the values using the color as a background color.
$Values = 100..125
foreach ($i in $values) {
$i | Get-256ColorRGB | Convert-RGBtoAnsi -Background |
ForEach-Object {
#show foreground ANSI RGB sequence
$escBG = $_.Replace("`e", "``e").Replace("[48","[38")
"$($_){0} = {1}`e[0m" -f $($i.ToString().PadLeft(5)), $escBG.PadRight(23)
}
}

I'll leave it to you to decide how you might use these functions in your own scripts or modules.
PowerShell Summit 2026

The PowerShell Summit will be here before you know it. Early bird tickets are already on sale. Watch the #PSHSummit tag on social media or check https://www.powershellsummit.org/ for announcements.
Speakers and sessions are slowly being announced. I am excited that Jeffrey Snover will be back to deliver a keynote.
Master PowerShell Parameters
I will be presenting a 45-minute session on Mastering PowerShell Parameters: Advanced Techniques and Best Practices. This demo-packed session will dive into advanced parameter design, showcasing new techniques introduced in PowerShell 7. I will cover advanced validation methods, leveraging types for greater efficiency, dynamic parameters, experimental features, and more.
I probably don't have many conferences left in me, so I hope you'll consider attending the Summit and catching my session.
OnRamp 2026
In addition to the main conference track, the PowerShell Summit also offers a track called OnRamp, which is a separate ticket. I led the OnRamp program for a number of years. The OnRamp program is aimed at PowerShell beginners, career changers, IT Pros getting started in automation and DevOps.
The event offers a number of full-ride scholarships to help people attend who might not otherwise be able to. If you know someone who would benefit from attending OnRamp, please encourage them to apply for a scholarship. Winners not only get a conference ticket, but air and hotel expenses are also covered. This is a fantastic opportunity. I assume my subscribers should attend the main conference, but you might know someone on your team that could benefit. Applications are open now. Visit https://www.powershellsummit.org/on-ramp to learn more and apply.
A New Scripting Challenge

'It wouldn't be the end of a month without another PowerShell scripting challenge. This time, I'm not going to provide as many hints as I usually do. Learning how to figure something out is just as important as the end result.
I will tell you that you will need to use the [System.IO.DriveInfo] class. You can use this class to enumerate drive information that looks like this:
Name : C:\
IsReady : True
RootDirectory : C:\
DriveType : Fixed
DriveFormat : NTFS
AvailableFreeSpace : 260322004992
TotalFreeSpace : 260322004992
TotalSize : 509722226688
VolumeLabel : Windows
You have to discover how to get this information using the class.
This output is your starting point. You need to write a PowerShell function that will return this information for all drives. However, make the output something that you can use in a pipelined expression and is useful to the user. You will be writing one or more objects to the pipeline that at a minimum, should like this:
Name : C:\
DriveType : Fixed
DriveFormat : NTFS
AvailableFreeSpace : 260322004992
TotalSize : 509722226688
PctFreeSpace : 51.11
VolumeLabel : Windows
Computername : Cadenza
Bonus points for adding a custom format file that shows sizes as formatted GB to 2 decimal places, plus whatever other enhancements you think would be useful.
As you write your function, you might also want to consider how to write it so that it scales. How could you write the function to get drive info from a group of remote computers?
Have fun with this challenge! I'll review my solution before the end of next month.
Summary
That's it for this month's PowerShell Potluck. I hope you found something useful or interesting. If you have any feedback or suggestions, please let me know.