Recently, I was chatting with my friend Gladys. As part of her work, she often creates Active Directory PowerShell-related tools for her colleagues. It is always good to be the toolmaker! Anyway, she doesn’t want to rely on the Active Directory module from Remote Server Administration Tools (RSAT). There’s no guarantee that the feature can…
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 – Painting a Pretty Picture with PowerShell
A few months ago, I wrote about my PSClock module. This is a set of PowerShell commands for creating a digital clock using a transparent WPF form. You can install the module from the PowerShell Gallery. The repository can be found at https://github.com/jdhitsolutions/PSClock. Because my Windows wallpaper changes throughout the day, sometimes I need to…
PowerShell 7 ConsoleGridView
Last night during my presentation for the Research Triangle PowerShell User Group, I briefly demonstrated a PowerShell 7 command called Out-ConsoleGridView. This command will not run in Windows PowerShell. If you haven’t thought about running PowerShell 7, maybe you’ll reconsider after learning more about this tool. You all know about Out-Gridview, which also works in…
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…
Behind the PowerShell Pipeline
Last week I made some passing references on Twitter to a new project I am working on this year. I thought I’d take a little time to explain it and hopefully entice a few of you into joining me. I’ve been blogging here for about ten years, if not longer. I typically share technical tutorials…
Tell PowerShell What You Want
I saw a question on Twitter the other day about how to include the Notes property when running the Get-VM Hyper-V cmdlet. I’m reading between the lines, but I think the desired goal was to include the Notes property. Here are a few ways you might tackle this problem. And even if you don’t use…
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…
Discovering Pester Tags with the PowerShell AST
As I resolved at the end of last year, I am doing more with Pester in 2022. I’m getting a bit more comfortable with Pester 5 and as my tests grow in complexity I am embracing the use of tags. You can add tags to different Pester test elements. Then when you invoke a Pester…