<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Aaron Marten : PowerShell</title><link>http://blogs.msdn.com/aaronmar/archive/tags/PowerShell/default.aspx</link><description>Tags: PowerShell</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>FolderShare + Powershell = Global Powershell Profile</title><link>http://blogs.msdn.com/aaronmar/archive/2007/06/27/foldershare-powershell-global-powershell-profile.aspx</link><pubDate>Wed, 27 Jun 2007 21:43:08 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3568521</guid><dc:creator>aaronmar</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/aaronmar/comments/3568521.aspx</comments><wfw:commentRss>http://blogs.msdn.com/aaronmar/commentrss.aspx?PostID=3568521</wfw:commentRss><wfw:comment>http://blogs.msdn.com/aaronmar/rsscomments.aspx?PostID=3568521</wfw:comment><description>&lt;p&gt;I am starting to force myself to learn new tricks and generally use &lt;a href="http://www.microsoft.com/windowsserver2003/technologies/management/powershell/default.mspx"&gt;Powershell&lt;/a&gt; more and more. The other day, I though to myself...wouldn't it be great if I could have a global profile and set of scripts on all the various machines that I use on a day-to-day basis?&lt;/p&gt; &lt;p&gt;For example, I added the &lt;a href="http://www.peterprovost.org/archive/2007/02/25/22315.aspx"&gt;UAC elevate function&lt;/a&gt; that Peter Provost wrote to my PS profile. How do I get this on all my machines without having to manually edit my profile file on each machine?&lt;/p&gt; &lt;p&gt;This became pretty easy with &lt;a href="https://www.foldershare.com/"&gt;FolderShare&lt;/a&gt;. I'm using FolderShare as basically a personal peer-to-peer service for my machines. I just set up all my machines to share the Documents\WindowsPowershell folder...and voila! Now all my machines use the same Powershell profile when I fire up powershell.exe! When&amp;nbsp;I make a tweak on one machine, the changed profile gets updated on all other other machines where I've set up FolderShare.&amp;nbsp;This also means that any scripts I add to that folder get automatically synced.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=3568521" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/aaronmar/archive/tags/PowerShell/default.aspx">PowerShell</category></item><item><title>Scripting Visual Studio with Windows PowerShell</title><link>http://blogs.msdn.com/aaronmar/archive/2007/02/06/scripting-visual-studio-with-windows-powershell.aspx</link><pubDate>Tue, 06 Feb 2007 19:34:20 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1612663</guid><dc:creator>aaronmar</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/aaronmar/comments/1612663.aspx</comments><wfw:commentRss>http://blogs.msdn.com/aaronmar/commentrss.aspx?PostID=1612663</wfw:commentRss><wfw:comment>http://blogs.msdn.com/aaronmar/rsscomments.aspx?PostID=1612663</wfw:comment><description>&lt;p&gt;One of the really cool new things that shipped recently that I've been trying to learn more about is &lt;a href="http://www.microsoft.com/windowsserver2003/technologies/management/powershell/default.mspx"&gt;Windows Powershell&lt;/a&gt;. What's really great about it is that if your object supports COM or .NET, you can automate it just by firing up the command line.&lt;/p&gt; &lt;p&gt;To get an instance of Visual Studio running, I can do the following :&lt;/p&gt; &lt;p&gt;$dte = New-Object -comobject "VisualStudio.DTE"&lt;/p&gt; &lt;p&gt;(Note that if you have multiple versions installed you can specify VisualStudio.DTE&lt;strong&gt;.7.0 &lt;/strong&gt;for VS 2002, VisualStudio.DTE&lt;strong&gt;.7.1 &lt;/strong&gt;for VS 2003 or VisualStudio.DTE&lt;strong&gt;.8.0 &lt;/strong&gt;for VS 2005.)&lt;/p&gt; &lt;p&gt;Since the DTE object was created via code and not by a user action, VS runs in silent mode (no user interface shown). I can show the main form with:&lt;/p&gt; &lt;p&gt;$dte.MainWindow.Visible = $true&lt;/p&gt; &lt;p&gt;For a useless example, if I want to close all the windows in the shell, I can do the following:&lt;/p&gt; &lt;p&gt;foreach ($w in $dte.Windows) { $w.Close() }&lt;/p&gt; &lt;p&gt;The cool thing about this really isn't that I can script Visual Studio (I could already do that from IronPython, VBScript or any other environment that can talk to COM objects), but that I can do it from the same command line that I use for other tasks in Windows.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=1612663" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/aaronmar/archive/tags/PowerShell/default.aspx">PowerShell</category><category domain="http://blogs.msdn.com/aaronmar/archive/tags/Automation/default.aspx">Automation</category></item></channel></rss>