Tag: Argument

Buggy WhatIf parameter…

I had recently to reset a bunch of user accounts. Before informing people about the change, and in order to test my script I used the WhatIf parameter. Unfortunately, the Set-ADAccountPassword cmdlet didn't return anything... And after a few minutes, people started to call for help about their password... I didn't know that this is … Continue reading Buggy WhatIf parameter…

How to validate credential argument for your function

You may know that it's a best practice to validate arguments you pass to your function. For example, if you want to validate that your parameter named MyString is not null nor empty you can use the ValidateNotNullOrEmpty attribute. But there are other validations which must be done through casting1 or type accelerators. And fortunately, … Continue reading How to validate credential argument for your function