

- #How to perform a clean uninstall of lync for mac 2011 how to#
- #How to perform a clean uninstall of lync for mac 2011 code#
- #How to perform a clean uninstall of lync for mac 2011 series#
- #How to perform a clean uninstall of lync for mac 2011 windows#
When I have the text of the current script stored in a variable, I pass it to the tokenizer by using the same code that I discussed in part 3 of the blog. It is also documented on TechNet, and in many of my own Hey Scripting Guy! blogs.
#How to perform a clean uninstall of lync for mac 2011 windows#
Each of those represent different objects, and you can use the Get-Member cmdlet to obtain the information needed to permit scripting against the Windows PowerShell ISE object model. In looking at the dotted notation, it makes sense: the $psISE, the CurrentFile, the Editor, and finally the Text. The second line of code is one of the most important -it obtains the code from the current file and stores it in the $b variable (the $b variable is the one that contains the Windows PowerShell code to be parsed by the tokenizer). The first line of code (OK…so it is actually two lines) is the function declaration, and the opening brace (curly bracket).

The code and the associated changes are shown in the following image. I did delete a bit of code, but I only added five new lines of code to the script. Rather than go line-by-line through the function, I will refer you to the three previous blogs (you should read them prior to jumping too deeply into this blog). The complete Remove-AliasFromScript function is shown here. I want to put it into a function, and then I will use it inside the Windows PowerShell ISE. To me, the best way to add the capability to remove aliases from a script, is to modify the script I used in the third blog. In this final installment, I modify the code that was used in the third blog to parse all of the scripts in a folder, so that that code will remove aliases from a script in the Windows PowerShell ISE. In the third blog in the series, I extended the concept of parsing text to parsing all of the Windows PowerShell scripts that are contained in a folder. In that post I discussed using the Windows PowerShell tokenizer to parse a section of text and return all of the Windows PowerShell commands from that text.
#How to perform a clean uninstall of lync for mac 2011 series#
The following day, I continued this series with my second post. In the first part of this series of blogs, I talked about creating a hash table that contained all of the aliases and their associated definitions. I could write an entire blog about the PowerShell Deep Dive, but I will resist that temptation for now, and get on with the fourth and final installment of my Remove-AliasesFromScript function. She wrote a blog on WordPress about Don Jones’ talk. Who knows, she might compete in the advanced category next year for the 2012 Scripting Games. The Scripting Wife received an invitation to the Don Jones preconference Windows PowerShell talk, and she came away from that talk just bubbling with excitement. In addition, I was able to secure commitments for a few more guest blogger posts, as well as talk to people about starting Windows PowerShell users groups. Anyway, it was really a lot of fun to meet everyone. After he said his name, I said, “Oh, yeah, now I get it,” because as it turned out he was wearing a shirt with the New England Patriots logo on it. Others, such as Glen Sizemore whose avatar is a football player for the New England Patriots, I did not recognize. The really cool thing was that with some people, as soon as they walked up I knew immediately who they were because they looked like their avatar on Twitter. The Scripting Wife and I both enjoyed meeting all of the people in real life that we had been emailing, tweeting, and following on Facebook. The PowerShell Deep Dive in Las Vegas, Nevada was a real treat. Microsoft Scripting Guy, Ed Wilson, here.
#How to perform a clean uninstall of lync for mac 2011 how to#
Summary: In this weekend scripter blog, learn how to modify the Windows PowerShell ISE so that it automatically removes aliases from a script.
