I use the cmdlet Start-Job and the parameter -AsJob pretty often in scripting. If I have a lot of iterative processing, then assigning each iteration to its own job really saves a lot of time. Say I have to check every computer...
Had a dumb idea a few weeks ago. What would "/" or "\" do if they did an action similar to "|"?
Maybe backslash runs the left command the same number of time....
When I first started transitioning over to pwsh version 7, I noticed that a very common parameter was missing from some very common cmdlets. Well - I noticed it when ....
When managing a domain, whether you are a one-man shop or one of many in a large enterprise, generating reports with pointed information is.....
Now that you're in this far, let's talk about how to use complicated code to make verbose even better. If you're not familiar with what "-Verbose" is, just try these cmdlets for a good...
Just wanted to throw a quick thanks to the people of r/PowerShell. I put a post on there tonight just to show off this project I've been working on. Fully expecting downvotes and no interaction - and I was very...
The CompareTo() method does just what it sounds like - compare 2 objects and determine the order of the 2 objects. It was created to have an easy way to compare versions of applications, scripts, whatever. So if you're scrip....
One of the curses of getting better at a skill, is that you eventually get the knowledge to look back at wha....
I wanted to do some clarifications on the details of pwsh modules and the files that make them up. In the manifest file, there are also some gotchas.......
Creating custom objects is the most efficient way to work with data from different sources. If you need to collect info on a virtual server in a vCenter, being able to combine data from AD and from.....
Quick one here to make output in the terminal a bit more readable to the user running the script. In a recent cmdlet I built, before the PROCESS block is run, the values of all the variables are out....
Creating snippets for PowerShell is a great way to up your efficiency. I completed the first draft of a project recently that required almost 200 separate function files. Each of those files...
So, if you have been using PowerShell for more than a few months (or hours likely), you've definitely used the Write-Host cmdlet. I would also bet that you have discovered the Write-Output cmdlet - probably even used it.....
Lets make a new cmdlet. A simple one, to make a current cmdlet work like even a PWSH novice would expect it to. I'll build a new cmdlet that calls the Get-Member cmdlet, but makes a .....
I recently found a new parameter in an old cmdlet I had not noticed before - and it doesn’t work. The Test-Path cmdlet does just that - tests that the path to a file or directory points to an existing object. The -IsValid parameter....
When creating advanced functions or cmdlets, the processing always follows the same basic flow. Blocks of code are processed starting with block BEGIN, then PROCESS, followed by END.
There are 2 problems with the Start-Transcript cmdlet. First, unlike most other cmdlets, assigning the output of the cmdlet only returns a string that the transcript was started, not an object. Most com...
Ran into a new problem today that somehow I have never had before. I created a PSCustom object to work with some XML. After collecting the data into the custom object, and then those objects into an array, I created a new variable ($newList) and assigned it the value of the original object ....
Working on a project this week I noticed that if() doesn't work exactly like I always thought it did. Of course, the normal way everyone expects is if the expression in the parens evaluates to true, then take the action the script block. But what I noticed is that the eval in the parens doesn't have to be "true".....
I have always seemed to have issues working with objects returned from Get-ChildItem. There was always some type of formatting that had to be done to the path string to use it in whatever next cmdlet I was.....