Developers are likely to be familiar with ternary conditional operators as they’re legal in many languages (Ruby, Python, C++, etc). They’re also often used in coding interviews to test an applicant as they can be a familiar source of code errors. While some developers couldn’t …
I’m going to file this under “Either I’m a genius, or there’s a much better way and everyone knows it except for me.”
I recently began adding a suite of Pester tests to one of my projects and I found myself needing to mock some unit tests against a particular function …
Index What is a Constrained Endpoint and Why Would I Need One?
Setup and Configuration
Using our Endpoint
What is a constrained endpoint and why would I need one? Powershell constrained endpoints are a means of interacting with powershell in a manner consistent with the principal of least privilege. …
I have written a short excerpt on how to pass parameters from an object to a Pester test. I have turned this into a function: Invoke-POVTest.
The function is primarily for operational validation tests, where you might have a single operational test but you need to test multiple cases. (Sorry, I am …
You can certainly find a number of articles around that present PowerShell pitfalls that can easily trip you up if you are not careful. I took a different approach in my three-part series, A Plethora of PowerShell Pitfalls.
The first two parts are presented in quiz format, together covering the top …
Pipelining is an important concept in PowerShell. Though the idea did not originate with PowerShell (you can find it used decades earlier in Unix, for example), PowerShell does provide the unique advantage of being able to pipeline not just text, but first-class .NET objects.
Pipelining has several …
Regular Expressions is often referred to as wizardry or magic and for that reason I stayed away from it for most of my career. I used it only when I had to and most of the time just reused examples that I found online. There’s nothing wrong with that of course, but I never took the time to …
Do you spend hours a day in PowerShell? Switching back and forth between PowerShell windows getting you down? Have you ever wanted “Quake” mode for your terminal?
If we are going to spend so much time in PowerShell, we may as well make it pretty.
Check out the Ultimate PowerShell Prompt …
At the beginning of July, we welcomed our 3rd son into the world. As days past my wife and I would say, “wow, he’s 11 days old. Can you believe it?!”. I’m sure parents out there are relating to this!
This gave me an idea for a fun script that would get your age in years, …
“To be or not to be”. Without getting into a debate over whether Shakespeare was musing about being a logician, suffice to say that in writing prose, the rules of when and how to use quotation marks are relatively clear. In PowerShell, not so much. Sure, there is an about_Quoting_Rules …