Like many of you I got tired of clicking through ADUG snapins to unlock users (as some days are worse than others). So I wrote a quick little function and added it into my profile to save some time. I work in the finance industry so for compliance I had to make sure I was only unlocking a single user account. The colors on the elseif were added just for fun, but I wanted to see if anyone had any better ideas as I still have a lot to learn when it comes to scripting and PowerShell.
It's looks good. You could also allow it to accept pipeline input and maybe even use an alias to give it extra flexibility. If you return a psobject, you can then also use this output with another function in a pipeline.
I've not checked the code below 100%, but this is a type of template of how you could add this.