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…
Category: Scripting
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…
Friday Fun: PowerShell Console Editing
The other day I read an interesting article on Adam Bertram’s blog about editing files with a text editor in PowerShell. Naturally, the PowerShell wheels in my head began turning. While I was intrigued by some of the options in the article, I’ve in fact installed the Micro editor to play with, I realized I…
Generate PowerShell Dynamic Parameter Code
One of the topics we’ve discussed in the PowerShell Cmdlet Working Group is a request to make it easier to insert dynamic parameters. I am a bit torn on this. On one hand, I see the value in dynamic parameters. These are parameters that only exist if some condition is met, such as if the…
Removing Obsolete PowerShell Remoting Configurations
I’m pretty sure I’ve discussed this before, but Microsoft is scheduled to release PowerShell 7.2 soon, I thought it might be good to revisit this topic. Here’s the potential issue. If you’ve been installing PowerShell 7 releases for a while, and have been enabling PowerShell remoting, you most likely have a list of remoting session…
Friday Fun: A PowerShell Welcome
I realized it had been a while since I wrote a Friday Fun post. These posts are intended to demonstrate PowerShell in a fun and often non-practical way. The end result is generally irrelevant. The PowerShell scripting techniques and concepts I use are the real takeaways. The task is nothing more than a means to…
Finding Modified Files with PowerShell
Here’s another task that I seem to be constantly fiddling with using PowerShell. What files did I work on yesterday? Or what files were modified in the last 48 hours? Obviously, Get-ChildItem is going to be the primary command. It is simple enough to get files based on an extension from a given folder path,…
There’s a File in My PowerShell Bucket
If there’s one task I’ve never stopped doing, it is finding files. I am constantly creating new ways to organize files and display them in a meaningful format. Naturally, PowerShell is a great tool for this task. Get-ChildItem is obviously the proper starting point. The cmdlet works fine in getting only files from a folder…
I Need a PSDrive Now!
I hope you’ve been enjoying the last few posts on working with PSDrives. To round out the set, I thought I’d remind you of a command in the PSScriptTools module that I use often, especially when teaching a live class or presenting at a conference. As you’ve seen, I use PSDrives as shortcuts to commonly…
Extending PowerShell PSDrives
Yesterday I shared some PowerShell code I use to managing my PSDrive assignments. My code works for me in my environment. But that doesn’t mean it is necessarily right for you and your environment. There are plenty of ways to use PowerShell to achieve the same results as my code. This is something you should…
Fun with Mapping PowerShell Drives
Because I spend my day working from a PowerShell prompt, I rely heavily on PSDrives to quickly access files and folders. And because I am mobile, I might be working at my desk in my home office, or I might be on the road with my trusty Thinkpad. Of course, this means, I want an…
Cleaning Up PowerShell Jobs
I am a heavy user of PowerShell jobs. Not only background jobs but also scheduled jobs. They are a critical element in my daily workflow. Every time a job runs, especially scheduled jobs, a job artifact remains which you can see using Get-Job. For scheduled jobs, I try to keep this to a minimum by…
Getting CIMInstance by Path
I am a member of the PowerShell Cmdlet Working Group. We’ve been looking into this issue and it is an intriguing one. Enough so that I spent some time looking into it and writing up some test code. If you work with WMI/CIM this might be of interest to you. Personally, I never have had…
Revisiting PowerShell Version Inventory
In the past, I’ve shared a variety of PowerShell approaches that you can use to inventory what versions of PowerShell are installed. But I think I now have the best approach short of searching the hard drive for powershell.exe and pwsh.exe, which I suppose is still a possibility and something I should write. Instead, I’m…
Hiding TaskBar Search with PowerShell
Yesterday I shared a few PowerShell functions for configuring the Windows 10 taskbar to auto-hide. This works great in my virtual desktop when recording my Pluralsight courses. But even when hidden I would still get an annoying white sliver from the search box. So I got rid of that as well. Here are some PowerShell…