I got some great comments and suggestion on my original version of Out-Notepad, which should work just find on PowerShell v1.0 or 2.0. However, because v2.0 has such terrific features I decided to rework my function into a PowerShell v2.0 only version that also incorporates a few new features.
Tag: functions
Out-Notepad
Maybe this isn’t the most earth shattering PowerShell function you’ll ever come across, but it saves me a few keystrokes. There are times when I want to see the results of PowerShell expression but the console output is insufficient. I want to see the results in a text file opened in Notepad so I can easily scroll, search or whatever.
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.
Updated Domain Password Report
My September Mr. Roboto column covers a PowerShell script you can use to create a domain password report. I also demo’d the script at the NYC Techmentor conference this past week. Since then I realized a mistake in the way that I laid out the script. I had nested a function within another function which…
Out-Twitter
My Out-Twitter function is available at http://blog.sapien.com/index.php/2008/06/23/out-twitter/. If you want, you can follow me @JeffHicks I’m sure you can come with an enhancement or two, and if so, I’d love to hear about them. Technorati Tags: PowerShell, Twitter, Scripting, JeffHicks
WSH and VBScript Core: TFM is here
I thought I’d take a moment to let you know that my new book is finally available. WSH and VBScript Core: TFM (SAPIEN Press). This book is a complete reference to Windows Script Host and VBScript. My goal was to replace the official Microsoft documentation with something that a Windows administrator would actually fine useful….
Get Latest File
I was helping out in the MSN Groups scripting forum recently. The admin needed to find the latest file or most recently modified file in a folder. That sounded reasonable to me so I put together a function and short script that uses it. I thought I’d share it here: ‘GetLatestFile.vbsstrDir=”S:”WScript.Echo “The newest file is…
More Fun with Get-Content
A few followups on my recent post about Get-Content. First, you can also use the CAT alias if you’re used to the Unix world, or TYPE in place of get-content. The Get-Content cmdlet does have a parameter called -totalcount that will return the specified number of lines from the beginning of the file: cat c:\boot.ini…