Windows PowerShell in Action: Working With Text and Files in Windows PowerShell
ScriptCenter has a couple chapters of Bruce Payette’s awesome book: Windows PowerShell in Action. You can (and should) read chapter 10 at:
Here what ScriptCenter says about it:
PowerShell is Microsoft’s next-generation command line and scripting solution. It combines the interactive capabilities of traditional shells such as bash or zsh with the programmability of scripting languages such as Perl or Ruby. Because PowerShell is based on .NET, it’s capable of doing things in a shell environment that were previously only possible in languages such as Visual Basic, VBScript, or C#.
As with any scripting language, one of the most important domains for PowerShell is the ability to work with strings and files (both text and binary). This series of articles is based on chapter 10 of Windows PowerShell in Action from Manning Publications. Chapter 10 examines how PowerShell handles text and file processing tasks, illustrating how to process and parse text using string objects and regular expressions. It also shows how to deal with paths and how to manipulate binary files. Another significant area covered in this chapter is how to work with XML. XML has become increasingly important both in the IT field and in software development. We show how to search, manipulate, and create XML documents using PowerShell.
Part one of this series looks at how to process, search, and manipulate strings and unstructured text using the .NET string object and regular expressions.
Jeffrey Snover [MSFT]
Windows PowerShell/MMC Architect
Visit the Windows PowerShell Team blog at: http://blogs.msdn.com/PowerShell
Visit the Windows PowerShell ScriptCenter at: http://www.microsoft.com/technet/scriptcenter/hubs/msh.mspx