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…
Tag: PowerShell
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…
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…
Accelerate Pester Test Development
The other day I shared my PowerShell plans for 2022. And needless to say, I didn’t wait to dig in. I am working on a new module and since it won’t be published until next month, I went ahead and marked it as Core only. I also started writing a set of Pester 5.x tests…
PowerShell Plans for 2022
I’m not much for writing year in review pieces. Nor, to be honest, do I often write New Year’s resolutions. But I’ve been thinking about the work I’ve done this past year and what I might be doing in 2022 so I thought I’d share some thoughts on what 2022 will look like for me,…
Building a PowerShell Module Inception-Style
Over the course of the last week or so, I’ve been sharing PowerShell functions and scripts for working with PowerShell functions and scripts. I showed PowerShell functions to export functions to a script file and code to convert scripts to functions It has all been very Inception-like. To wrap this all up I thought I’d…
Fun with PowerShell Module Layout
As I’ve been working on my new PowerShell project, which I’ve discussed over recent posts, I keep “discovering” fun scripting opportunities. Today I want to share some code I’ve come up with that makes it easier to build a PowerShell module directory structure. There are plenty of existing tools and scripts for scaffolding a project…