Now Available:

Featured Resource:

line

Newsletter

Email Address:


line

Ask the Expert

Have a question for our resident expert? Email your questions to Greg.

« Office 2007 SP1 is Now Available | Main | Will There be a Server 2008 RC2? »

Don Jones’ Favorite PowerShell Cmdlets, Part 10 of 10: Out-File

Sure, you might think that redirecting output to a file is as simple as using the > operator:

Get-Process > c:\procs.txt

And, er, you’d be right. It is that simple. But under the hood, you’re really using the Out-File cmdlet, and like with most “under the hood” things, using the cmdlet itself gives you way more options for your output: Append to an existing file, force the overwrite of an existing file, and even specify output encoding. This is especially helpful if you’re producing a specialized type of file, such as an XML file that usually requires UTF-8 encoding. Get to know Out-File’s options, and get to know its friends, like Out-Printer, too. Heck, I use Out-File so much I made an alias for it:

Click past the fold for more…

New-Alias of Out-File

And that’s the end of my 10-part series of my favorite cmdlets. I hope you’ve discovered a new one or two, and learned some new capabilities of some common cmdlets that you may already have been familiar with. Catch my regular blog on www.PowerShellCommunity.org for more PowerShell goodness!

Don Jones is the Lead Scripting Guru for SAPIEN Technologies and a Windows PowerShell MVP. He’s the co-author of Windows PowerShell: TFM, 2nd Edition and is the Windows PowerShell columnist for TechNet Magazine. Don is also the Director for the new centralized, independent PowerShell online community: www.PowerShellCommunity.org.

Get your hands on the full Don Jones Favorite Cmdlets Series at this address:
http://www.realtime-windowsserver.com/type/mt-search.cgi?tag=don%20jones%20favorite%20cmdlets&blog_id=1

TrackBack

TrackBack URL for this entry:
http://www.realtime-windowsserver.com/type/mt-tb.cgi/507

Post a comment

(All comments are approved by site leader before appearing here. Thanks for commenting!)

line

Greg Shields' Bio:

Greg Shields, is an independent author, instructor, and IT consultant based in Denver, Colorado, and a co-founder of Concentrated Technology. With nearly 15 years of experience in information technology, Greg has developed extensive experience in systems administration, engineering, and architecture specializing in Microsoft systems management, remote application, and virtualization technologies. Greg is a Contributing Editor for Redmond Magazine, MCPmag.com, and Virtualization Review Magazine and is the author of five books, including Windows Server 2008:  What’s New / What’s Changed. Greg is also a highly sought-after instructor and speaker, speaking regularly at conferences like TechMentor Events, and producing computer-based training curriculum for CBT Nuggets.  Greg is a recipient of Microsoft "Most Valuable Professional" award with a specialization in Windows Terminal Services.