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…
Tag: Scripting
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…
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…
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…
Discovering Aliases with the PowerShell AST
I’ve been working on a new PowerShell module that incorporates code from a few of my recent posts on converting PowerShell scripts and functions to files. I even whipped up a script, think of it as a meta-script, to create the module using the commands that I am adding to the module. I’ll cover that…
Converting PowerShell Scripts to Functions
Recently, I shared some PowerShell code to export a function to a file. It was a popular post. My friend Richard Hicks (no relation) thought we was joking when he asked about converting files to functions. His thought was to take a bunch of PowerShell scripts, turn them into a group of functions which could…
Exporting PowerShell Functions to Files
When I write a PowerShell module, it typically includes more than one export function. Where you store your module functions is a great discussion topic and I don’t think there is necessarily one best practice for everyone. I think it might depend on the number and complexity of the functions. Are other people contributing code…
Creating a PowerShell Clock
I’ve published a new project to the PowerShell Gallery. This is something that I needed, and maybe you do as well. Even though I have the typical clock running in the Windows taskbar, I have an ultrawide monitor so it isn’t always easy to read. I had been running the xclock app from WSL which…