Tag Archives: parameters

Get Parameter

As I continue to work on the 2nd edition of Managing Active Directory with Windows PowerShell: TFM, I find situations where I need a tool to get information out of Windows PowerShell. For example, the cmdlets in the Microsoft Active … Continue reading

Posted in PowerShell, Scripting | Tagged , , , | 1 Comment

Bool vs Switch

I have to say I’m generally impressed with the quality of submissions to this year’s Scripting Games. But there is a recurring concept that some people are using and I think there’s a better way. Some contestants are defining function … Continue reading

Posted in Best Practices, PowerShell v2.0, Scripting | Tagged , , , | 4 Comments

More Fun with Get-NumberedContent

As much fun as the original Get-NumberedContent function was after using it for awhile I realized I had imposed some limitations. I also realized it needed to be more flexible. What if someone wanted to specify a different color or … Continue reading

Posted in PowerShell v2.0, Scripting | Tagged , , , , , , | Comments Off

Out-MSWord Revised

This summer I wrote about a function I developed called Out-MSWord. The function was discussed in my Practical PowerShell column which was published in the free e-Journal Windows Administration in RealTime put out by RealTime Publishers. The original was published in Issue #17 if you are interested. The function accepted pipelined input and created a Microsoft Word document. Naturally, you need to have Microsoft Word installed in order for this to work.

PS C:\> get-service | out-MSWord

The function accepted a number of parameters so you could control font name, size, color, append, and more. The function was written for PowerShell v1.0 but also worked on PowerShell v2.0. However, I was revisiting the function and realize there were places I could tweak, such as adding additional error handing. I also realized that if rewrote this for PowerShell v2.0, I could create an advanced function and take advantage of cmdletbinding, advanced parameters and help. Continue reading

Posted in CommandLine, PowerShell v2.0, RealTime, Scripting | Tagged , , , , , | Comments Off