<?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>Show-PowerShell / Hide-PowerShell</title><link>http://blogs.msdn.com/powershell/archive/2008/06/03/show-powershell-hide-powershell.aspx</link><description>During the Week of WPF, someone requested an example of how to minimize the PowerShell window. Here's a quick module to make it happen.&amp;#160; Copy/paste the code below into Documents\WindowsPowerShell\Packages\PowerShell\PowerShell.psm1 $script:showWindowAsync</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>re: Show-PowerShell / Hide-PowerShell</title><link>http://blogs.msdn.com/powershell/archive/2008/06/03/show-powershell-hide-powershell.aspx#8571678</link><pubDate>Tue, 03 Jun 2008 18:33:43 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8571678</guid><dc:creator>Pablo</dc:creator><description>&lt;p&gt;Yes, It works but only when you launch the shortcut to Windows PowerShell V2 (CTP2) previously. If you first type cmd.exe and then you type:&lt;/p&gt;
&lt;p&gt;powershell.exe script.ps1 you have 2 different pids (one for cmd.exe and one for powershell.exe)&lt;/p&gt;
&lt;p&gt;It would be great that we can hide completely the powershell console window (not minimize) while the script is executing :)&lt;/p&gt;</description></item><item><title>re: Show-PowerShell / Hide-PowerShell</title><link>http://blogs.msdn.com/powershell/archive/2008/06/03/show-powershell-hide-powershell.aspx#8573937</link><pubDate>Wed, 04 Jun 2008 23:20:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8573937</guid><dc:creator>Just Another Sysadmin</dc:creator><description>&lt;p&gt;I know this isn't the WPF way of doing things, but I wanted this functionality early on with Powershell v1 after having been spoiled by Quake-style terminals like Yakuake. I stumbled across AutoHotkey (&lt;a rel="nofollow" target="_new" href="http://www.autohotkey.com"&gt;http://www.autohotkey.com&lt;/a&gt;) which basically allows you to create mini scripts and map them to user-specified key combinations.&lt;/p&gt;
&lt;p&gt;The following AutoHotkey script shows/hides a console with a WindowsKey+` combination, although you can tweak it to whatever combination you want. If a console is not already running when the key combination is struck, a new Powershell window is launched:&lt;/p&gt;
&lt;p&gt;#`::&lt;/p&gt;
&lt;p&gt;DetectHiddenWindows, on&lt;/p&gt;
&lt;p&gt;IfWinExist ahk_class ConsoleWindowClass&lt;/p&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt;	IfWinActive ahk_class ConsoleWindowClass&lt;/p&gt;
&lt;p&gt;	 &amp;nbsp;{&lt;/p&gt;
&lt;p&gt;			WinHide ahk_class ConsoleWindowClass&lt;/p&gt;
&lt;p&gt;			WinActivate ahk_class Shell_TrayWnd&lt;/p&gt;
&lt;p&gt;		}&lt;/p&gt;
&lt;p&gt;	else&lt;/p&gt;
&lt;p&gt;	 &amp;nbsp;{&lt;/p&gt;
&lt;p&gt;	 &amp;nbsp; &amp;nbsp;WinShow ahk_class ConsoleWindowClass&lt;/p&gt;
&lt;p&gt;	 &amp;nbsp; &amp;nbsp;WinActivate ahk_class ConsoleWindowClass&lt;/p&gt;
&lt;p&gt;	 &amp;nbsp;}&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;else&lt;/p&gt;
&lt;p&gt;	Run C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe&lt;/p&gt;
&lt;p&gt;DetectHiddenWindows, off&lt;/p&gt;
&lt;p&gt;return&lt;/p&gt;
&lt;p&gt;Works a treat!&lt;/p&gt;</description></item><item><title>@Pablo</title><link>http://blogs.msdn.com/powershell/archive/2008/06/03/show-powershell-hide-powershell.aspx#8578580</link><pubDate>Fri, 06 Jun 2008 20:57:26 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8578580</guid><dc:creator>Marco Shaw</dc:creator><description>&lt;p&gt;Check this out maybe:&lt;/p&gt;
&lt;p&gt;&lt;a rel="nofollow" target="_new" href="http://blog.sapien.com/index.php/2006/12/26/more-fun-with-scheduled-powershell/"&gt;http://blog.sapien.com/index.php/2006/12/26/more-fun-with-scheduled-powershell/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Uses VBScript to hide the PowerShell window.&lt;/p&gt;</description></item><item><title>re: Show-PowerShell / Hide-PowerShell</title><link>http://blogs.msdn.com/powershell/archive/2008/06/03/show-powershell-hide-powershell.aspx#8584217</link><pubDate>Mon, 09 Jun 2008 10:41:24 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8584217</guid><dc:creator>Marco Shaw </dc:creator><description>&lt;p&gt;Thanks for the info. Interesting workaround when we need to run powershell commands in background but it doesn&amp;#180;t work when we need to show windows forms :(&lt;/p&gt;</description></item><item><title>@Just Another Sysadmin</title><link>http://blogs.msdn.com/powershell/archive/2008/06/03/show-powershell-hide-powershell.aspx#8837215</link><pubDate>Wed, 06 Aug 2008 15:44:53 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8837215</guid><dc:creator>Pepa Stefan</dc:creator><description>&lt;p&gt;Thanks for the AutoHotkey script. It works great!&lt;/p&gt;</description></item><item><title>re: Show-PowerShell / Hide-PowerShell</title><link>http://blogs.msdn.com/powershell/archive/2008/06/03/show-powershell-hide-powershell.aspx#9837941</link><pubDate>Sat, 18 Jul 2009 01:32:15 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9837941</guid><dc:creator>Boris</dc:creator><description>&lt;p&gt;It also work with windows forms but you need launcher&lt;/p&gt;
&lt;p&gt;&lt;a rel="nofollow" target="_new" href="http://filesystemobject.blogspot.com/2009/04/pscript-der-powershell-script-launcher.html"&gt;http://filesystemobject.blogspot.com/2009/04/pscript-der-powershell-script-launcher.html&lt;/a&gt;&lt;/p&gt;</description></item></channel></rss>