PowerTip: Use a regular expression pattern to remove nonalphabetic characters

Summary: Learn how to use a regular expression pattern to remove non-alphabetic characters from a string by using Windows PowerShell.  How can I use Windows PowerShell to remove non-alphabetic characters from a string?  To remove nonalphabetic characters from a string, you can use the -Replace operator and substitute an empty string ‘’ for the nonalphabetic…


PowerTip: Use PowerShell to Replace Characters in String

Summary: Use Windows PowerShell to replace non-alphabetic and non-number characters in a string.  How can I use Windows PowerShell to replace every non-alphabetic and non-number character in a string            with a hyphen?  Use the Windows PowerShell –Replace operator and the \w regular expression character class.            The \w character class includes the letters…


Weekend Scripter: Remove Non-Alphabetic Characters from String

Summary: Microsoft Scripting Guy, Ed Wilson, talks about using Windows PowerShell to remove all non-alphabetic characters from a string. Microsoft Scripting Guy, Ed Wilson, is here. This morning I am drinking a nice up of English Breakfast tea and munching on a Biscotti. I know…Biscotti is not a very good breakfast. Oh well. I went…


PowerTip: Replace Characters in String that Is Not Part of Group

Summary: Use Windows PowerShell to replace all characters in a string that is not part of a group.  How can I use Windows PowerShell to remove all the non-alphabetic characters in the following string?           (The single quotation marks are not part of the string.) ‘({Abcde})’  Create a regular expression pattern (character…


PowerTip: Use PowerShell to Remove Characters in a String

Summary: Learn how to use Windows PowerShell to remove specific characters in a string.  I have a string that includes braces: $a = ‘{Abcde}’    I want to remove the braces, but keep the text string inside the braces.    How can I do this by using Windows PowerShell?  Use the –Replace operator, create a regular expression…


Use PowerShell to Move Computers Based on IP Addresses: Part 2

Summary: In this blog, Eric Wright revises his script by using Active Directory cmdlets to move computers that are organized in Active Directory, based on their IP addresses. Microsoft Scripting Guy, Ed Wilson, is here. In today’s post, guest blogger, Eric Wright, reprises yesterday’s post to use the Windows Active Directory module cmdlets. Here is…


Use PowerShell to Move Computers Based on IP Addresses: Part 1

Summary: In this guest blog post written by Eric Wright, you will learn how to use the Windows PowerShell snap-in, Quest ActiveRoles, to move computers that are organized in Active Directory, based on their IP addresses. Microsoft Scripting Guy, Ed Wilson, is here. Guest Blogger Weekend continues. Today we have a guest blog written by…


Use PowerShell and Regular Expressions to Parse Handle Output

Summary: Windows PowerShell superhero BATCHman uses regular expressions to parse output from handle.   Microsoft Scripting Guy Ed Wilson here. Today we have Episode 10 of the BATCHman series.   Whenever trouble happens in systems and people will call, and darkness rolls out causing your fall, Creatures of bits roam in the night, Shine to…


BATCHman Uses PowerShell to Thwart Dr. Regex and Save the Zoo

Summary: In this exciting episode, BATCHman uses Windows PowerShell and regular expressions to thwart the evil Dr. Regex and save the monkeys.   Microsoft Scripting Guy, Ed Wilson, is here. Sean Kearney is back with us for three more episodes of the thrilling BATCHman series. Today is Episode 4. Whenever trouble happens in systems and…


Expert Solution for 2011 Scripting Games Advanced Event 7: Use PowerShell and Regex to Get Twitter IDs from a Web Page

Summary: Microsoft Windows PowerShell MVP, Tome Tanasovski, uses regular expressions to get Twitter IDs from a web page while solving Advanced Event 7 in 2011 Scripting Games. Microsoft Scripting Guy, Ed Wilson, here. Tome Tanasovski is the expert commentator for Advanced Event 7. Tome is a Windows engineer for a market-leading, global financial services firm…

7