Reusable ValidateSets in PowerShell

When you’re creating scripts, in some cases, you may want to limit what values a consumer is allowed to provide for a specific parameter. In PowerShell a regular way to do that is with ValidateSet. ValidateSet is an attribute that you can define on a parameter together with a set of values that are allowed to be provided for the parameter. For example, let’s say you want to only allow to specify Development, Staging or Production as a value for the $DeploymentEnvironment parameter in your PowerShell script, with help of ValidateSet. It can look something like this: ...

July 15, 2025 · 4 min · Kristina Devochko

Automate .NET target framework update with PowerShell

With all the active development in the .NET world many of us have faced a situation where we need to update .NET target framework more frequently in order to be able to keep up, but at the same time to be able to utilize all the goodies .NET has to offer. It’s not a big deal when you have 1, 2, 10 projects but when you have 300+ projects that need to be updated? Then it can become a pretty boring and time-consuming process. And what’s boring must always be automated, right? 😉 ...

March 28, 2022 · 3 min · Kristina Devochko