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…
Tag: CIM
Update Registry OS ProductName with PowerShell
I expect many of you are like me and have done, or will do, an in-place upgrade from Windows 10 to Windows 11. It is easy enough to run a PowerShell expression like this to see the operating system name. I get a value like Windows 11 Pro. However, operating system information is also stored…
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…
Searching for PowerShell with CIM
Yesterday I shared a script that you could use to inventory systems for Windows PowerShell and PowerShell 7 installations. This should work for most people who install PowerShell 7 with the provided installer. But, as has been pointed out more than once to me, this won’t detect any side-loaded or out-of-band installations. I made reference…
Answering the CIM Directory Challenge
The last Iron Scripter challenge of 2020 was a big one. If you didn’t get a chance to work on it, see what you can come up with then come back to see my approach. As with many of the challenges, the goal isn’t to produce a production-ready PowerShell tool, but rather to push the…
Finding Zombie Files with PowerShell
Since this is Halloween weekend in the United States, I thought I’d offer up a PowerShell solution to a scary task – finding zombie files. Ok, maybe these aren’t really living dead files, but rather files with a 0-byte length. It is certainly possible that you may intentionally want a 0 length file. But perhaps…
Watching the Watcher with PowerShell
If you followed along with my recent articles about my PowerShell based backup system, you may recall that I used a PowerShell scheduled job an an event subscriber to monitor for file changes in key folders that I want to back up. I created the scheduled task to run at Windows startup and so far…
The Ultimate PowerShell Telemetry Prompt
Well, I knew I wouldn’t be satisfied. The other day I shared a PowerShell prompt function that could display telemetry like information for a few remote servers. One of the drawbacks was the limited amount of information I could display. I’ve revised that function and have a new version that displays additional information via a…
My Telemetry PowerShell Prompt Function
I’ve enjoyed building these PowerShell prompt functions. Because performance is critical, it has forced me to create efficient code. For example, I’ve been using Get-CimInstance to retrieve select properties from certain classes. Because I know in advance what properties I need, I can tell Get-Ciminstance to only get and return those properties. With today’s version,…
Revised Everything PowerShell Prompt
Since it is Friday and time for some more PowerShell fun, and I’ve been sharing some of my prompt functions, I thought I’d re-share my kitchen sink prompt. This PowerShell prompt function does *a lot* to things and gives you a snapshot view of your system everytime you press enter. It will work cross-platform, but…
Searching for a CIM/WMI Class with PowerShell
I got a question on Twitter about an older function I has posted to get antivirus information via WMI. The function continues to work fine with Windows 10, although there’s always room for improvement. However, the question was that the function did not seem to work when querying a server running Windows Server 2016 or…
A PowerShell Mystery
The other day I was prepping for my sessions at the upcoming PowerShell + DevOps Global Summit. As I usually do, when I am building demos that will connect to remote machines I often use the local computer as a placeholder. This should always work right? so imagine my surprise when this command gave me…
Who is Running Your PowerShell Script?
I’ve often talked about the benefit of including Verbose output in your PowerShell scripts and functions from the very beginning. This is especially helpful when someone else is running your command but encounters a problem. You can have them start a transcript, run your command with –Verbose, close the transcript and send it to you….
Are You My Type?
I am always stressing that PowerShell is all about the objects. If you keep this in mind, PowerShell is pretty easy to use. Get a bunch of things, and select the details that you want to see or work with. Out of the box PowerShell gives you some very rich objects to work with from…
Friday Fun: Listing WMI Namespaces
Welcome once again to the end of the week. Hopefully you spent some time in PowerShell. If not, perhaps this tidbit will be intriguing enough to give it a try. I always try to put the “fun” in function and today I have one that will enumerate all the WMI namespaces, but using Get-CimInstance, or…