Category Archives: PowerShell

Friday Fun: 13 More Scriptblocks

In celebration of Friday the 13th I thought I would offer up a menu of 13 more script blocks. If you missed the first course, you can find the original 13 scrptblocks here. I’m not going to spend a lot … Continue reading

Posted in Friday Fun, PowerShell, Scripting, WMI | Tagged , , , , , , | Leave a comment

PowerShell Scripting with [ValidateScript]

The last few days we’ve been looking at parameter validation attributes you might use in a script of function. Yesterday I wrote about [ValidateRange] and demonstrated how you might use it. That attribute works fine for any values that can … Continue reading

Posted in PowerShell, Scripting | Tagged , , , , | 2 Comments

PowerShell Scripting with [ValidateRange]

After my post yesterday on using the ValidateScript attribute with PSCredentials, I thought you might find it helpful to have a brief discussion on some other parameter validation attributes such as [ValidateRange()]. You can use this attribute if you want … Continue reading

Posted in PowerShell, Scripting | Tagged , , , | 9 Comments

Scripting with PSCredential

I see this question often: how can I pass a parameter value for a PSCredential that might be a credential object or it might be a user name? In the past I’ve used code like this: begin {     … Continue reading

Posted in PowerShell, security, WMI | Tagged , , , , , | 14 Comments

Friday Fun: Get Next Available Drive Letter

A few days ago I saw on question, I think on Facebook, about using PowerShell to find the next available drive letter that could be used for mapping a network drive. Before I show you my approach, let me state … Continue reading

Posted in Friday Fun, PowerShell, Scripting | Tagged , , , | 6 Comments