This is a reprint of an article published earlier this year in my premium PowerShell newsletter, Behind the PowerShell Pipeline. This is a sample of what my subscribers get 6-8 times a month. I expect I will write several articles about PowerShell and its relationship with objects. I know that this is the biggest hurdle…
Tag: Function
Using PowerShell Your Way
I’ve often told people that I spend my day in a PowerShell prompt. I run almost my entire day with PowerShell. I’ve shared many of the tools I use daily on Github. Today, I want to share another way I have PowerShell work the way I need it, with minimal effort. This specific task centers…
Open Up Wide
I recently read a terrific post from Mike F. Robbins about using Format-Wide to display strings. Format-Wide is one of those cmdlets that I don’t think gets much use. This is a shame because it certainly fulfills a need. But as Mike points out, if you have a list of strings, Format-Wide requires a little…
Introducing PSProjectStatus
I write a lot of PowerShell modules. And probably like you, I am working on more than one project at a time. I was finding it difficult to keep track of what I was working on and what I might be neglecting. So I turned to PowerShell and created a tool that I use to…
I SID You Not!
As usually happens during my day, I get sidetracked to another issue, and before you know it, I have a new PowerShell tool. In this instance, I was looking at event logs using Get-WinEvent. One of the event record properties is a UserID. That’s very nice, but who is this? In this particular instance, the…
Metric Meta PowerShell Scripting
I was fiddling around with PowerShell the other day. I spend my day in front of a PowerShell prompt and am always looking for ways to solve problems or answer questions without taking my hands off the keyboard. For some reason, I started thinking about metric conversions. How many feet are 50 meters? How many…
Copy to Multiple Destinations with PowerShell
In honor of today, 2/22/2022, I thought I’d share a PowerShell function that allows you to copy files to multiple destinations. If you look at help for Copy-Item, which you should, you’ll see that the Destination parameter does not take an array. That’s ok. I can fix that. However, I have a disclaimer that you…
Friday Fun with PowerShell and Alternate Data Streams
I have always had a peculiar fascination with alternate data streams. This is an NTFS feature that has been around for a long time. The feature, also referred to as ADS, allows a user to write data to a hidden fork of a file. You can store practically anything in an alternate data stream without…
Even More Colorful Fun with PowerShell and WPF
Let’s continue looking at how to use PowerShell and a Windows Presentation Foundation (WPF) form to display [System.Drawing.Color] values. This article builds on an earlier post so if you missed it, take a few minutes to get caught up. As I did earlier, before running any WPF code in PowerShell, you should load the required…
More Colorful Fun with PowerShell
In my last Friday Fun post, I shared some PowerShell code for displaying [System.Drawing.Color] values from a console using ANSI escape sequences. After I published the article, I realized what I really wanted was a color palette display that wouldn’t be affected by the console background. A Windows Presentation Foundation (WPF) form would do the…
Friday Fun: Redacting with PowerShell
It has been a while since my last Friday Fun post. These are articles that use PowerShell in fun and off-beat ways. The goal is to demonstrate techniques and concepts not necessarily give you something ready for production. Today, I’m going to modify PowerShell output to hide, or redact, potentially sensitive information. I might want…
Profile PowerShell Functions
I’ve published a stable release of the PSFunctionTools module to the PowerShell Gallery. Previously, it was pre-release. The module requires PowerShell 7.1 and later. Although, as I have mentioned in the past, you are welcome to fork the repository and create a version that will run on Windows PowerShell. I wanted to point out a…
Prerelease of PSFunctionTools for PowerShell
At the end of last year wrote a series of blog posts describing tools and techniques for working with PowerShell scripts and functions. My goal was to build a framework of tools that I could use to automate PowerShell scripting work, such as creating a new module from a group of existing files. I’ve finally…
Copy PowerShell History Command
I thought I’d share a short but useful PowerShell utility. This is something that is very handy when I am writing. As you know, PowerShell maintains a command history in your PowerShell session. You can view history with the Get-History cmdlet or its alias h. To re-rerun a command use Invoke-History or its alias r,…
Discovering Pester Tags Revisited
Yesterday I shared some PowerShell code I wrote to discover tags in a Pester test. It works nicely and I have no reason to complain. But as usual, there is never simply one way to do something in PowerShell. I got a suggestion from @FrodeFlaten on Twitter on an approach using the new configuration object…