Springtime is approaching in North America. Where I live, the snow has finally melted and we have blue skies with warmer temperatures. Of course, this means Spring Cleaning. Time to clear out the winter debris and spruce up the house. For me, this is also a good time for some computing housecleaning as well. I…
Tag: Function
Solving Another PowerShell Math Challenge
Last month, the Iron Scripter Chairman posted a “fun” PowerShell scripting challenge. Actually, a few math-related challenges . As with all these challenges, the techniques and concepts you use to solve the challenge are more important than the result itself. Here’s how I approached the problems. Problem #1 The first challenge was to take a…
Comparing PowerShell Property Names
Recently, I was chatting with my friend Gladys Kravitz about the hassle of comparing objects in PowerShell. Even after all these years. She has a specific use case, but you might also feel the need for a better comparison option. And to be clear, the comparison we’re talking about is not the object’s values, as…
Building a PowerShell Tool for Active Directory Changes
A few days ago, I posted a PowerShell script I wrote that creates a formatted HTML report, complete with collapsible regions, which shows recent changes to objects in your Active Directory domain. Including objects that have been deleted, assuming you enabled the Active Directory RecycleBin feature. I am pleased with the result and many of…
Solving the PowerShell Conversion Challenge
Today let’s look at how I approached the first Iron Scripter PowerShell challenge of the year. The goal of the challenge was to convert or translate an object into a PowerShell class definition. If you are new to these challenges, the journey to how you achieve the goal is more valuable than the end result….
Answering the PowerShell Registered User Challenge
A few weeks ago, an Iron Scripter PowerShell challenge was issued. This was a beginner to intermediate level challenge to get and set the registered user and/or organization values. These challenges, and solutions such as mine, aren’t intended to production-ready tools. Instead, you should use them as learning vehicles to advance your PowerShell scripting skills….
Parsing ssh Known Hosts with PowerShell and Regular Expressions
Lately, I’ve been spending time learning more about ssh. Sadly, I’ve rarely had a need to learn and use ssh. But of course, with PowerShell 7 and ssh-based remoting, it is time to up my game. I’ve started deploying the ssh server component to my Windows test servers (I’ll write about that another day) and…
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…
Friday Fun: Back to School with PowerShell
For today’s fun with PowerShell, I thought I’d share my solutions for a recent Iron Scripter challenge. If you aren’t familiar with these challenges, and you should be, they are designed to test your PowerShell skills and hopefully help you learn something new. There are challenges for all skill levels and you can tackle them…
Friday Fun – A PowerShell Nonsense Challenge
Today I thought I’d share my PowerShell solution to a recent Iron Scripter challenge. The challenge was to create PowerShell code that would create nonsense documents, with a goal of creating 10 sample files filled with gibberish. Yes, other than maybe wanting some test files to work with, on its face the challenge appears pointless. …
Discovering Provider Specific Commands
I’ve been diving into PowerShell help lately while preparing my next Pluralsight course. One of the sad things I have discovered is the loss of provider-aware help. As you may know, some commands have parameters that only exist when using a specific PSDrive. For example, the -File parameter for Get-ChildItem only works in the file…
Solving the PowerShell Object Age Challenge – Part 2
The other day I shared part of my solution to an Iron Scripter challenge to write a generic function to report on the age of an object. The idea being that you could pipe any type of object to the function and get a result. And because I can’t help myself, I went a bit…
Solving the PowerShell Object Age Challenge – Part 1
A few weeks ago, the Iron Scripter site posted an interesting challenge about writing a generic function to get the age of objects. Many things that we deal with in PowerShell have an “age” such as files, processes or even AD groups and users. I think this is an especially useful exercise because it forces…
Solving the PowerShell Counting Challenge
A few weeks ago, an Iron Scripter PowerShell scripting challenge was posted. As with all of these challenges, the process is more important than the end result. How you figure out a solution is how you develop as a PowerShell professional. A few people have already shared their work. Today, I thought I’d share mine….
A PowerShell Remote Function Framework
The other day I shared a PowerShell function to query the registry on remote computers to find installed versions of PowerShell. The function leveraged PowerShell remoting with the flexibility of using a computer name with an optional credential or existing PSSessions. The more I thought about it, the more I realized that the structure could…