<?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>Detection logic for PowerShell installation</title><link>http://blogs.msdn.com/b/powershell/archive/2009/06/25/detection-logic-poweshell-installation.aspx</link><description>"How do we programmatically detect that PowerShell is installed ?" - This question has started coming up frequently as more folks (both internally and externally) have started to build applications with PowerShell support. As we approach Win7/W2K8-R2</description><dc:language>en-US</dc:language><generator>Telligent Evolution Platform Developer Build (Build: 5.6.50428.7875)</generator><item><title>re: Detection logic for PowerShell installation</title><link>http://blogs.msdn.com/b/powershell/archive/2009/06/25/detection-logic-poweshell-installation.aspx#10319387</link><pubDate>Wed, 13 Jun 2012 15:53:21 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10319387</guid><dc:creator>powershell makes me sad</dc:creator><description>&lt;p&gt;How about you write a script that tells us which version of powershell to install via OS and then tries to install it. 4 tries of my OS (windows 7 64 bit) and each one gives me the &amp;#39;this install is not applicable to your system&amp;#39; everytime.&lt;/p&gt;
&lt;p&gt;You know what doesn&amp;#39;t give me this error? EVERY OTHER scripting language!&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10319387" width="1" height="1"&gt;</description></item><item><title>re: Detection logic for PowerShell installation</title><link>http://blogs.msdn.com/b/powershell/archive/2009/06/25/detection-logic-poweshell-installation.aspx#10177811</link><pubDate>Wed, 22 Jun 2011 14:39:06 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10177811</guid><dc:creator>richard semock</dc:creator><description>&lt;p&gt;How is PS removed from win2003? KB 139 &amp;amp; 141 are not found in add/remove updates and 2003-sp2 is removed but PS aritfacts remain in registry and in system32 folder.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10177811" width="1" height="1"&gt;</description></item><item><title>re: Detection logic for PowerShell installation</title><link>http://blogs.msdn.com/b/powershell/archive/2009/06/25/detection-logic-poweshell-installation.aspx#10096734</link><pubDate>Thu, 25 Nov 2010 17:40:26 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10096734</guid><dc:creator>David M</dc:creator><description>&lt;p&gt;I see the team have addressed this in version 2 with the $psversiontable structure.&lt;/p&gt;
&lt;p&gt;The foillowing code should do the trick:&lt;/p&gt;
&lt;p&gt;if ( $psversiontable ) { &amp;#39;v2+&amp;#39; } else { &amp;#39;v1&amp;#39; }&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10096734" width="1" height="1"&gt;</description></item><item><title>re: Detection logic for PowerShell installation</title><link>http://blogs.msdn.com/b/powershell/archive/2009/06/25/detection-logic-poweshell-installation.aspx#10036549</link><pubDate>Fri, 09 Jul 2010 19:32:21 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10036549</guid><dc:creator>David M</dc:creator><description>&lt;p&gt;Is there a simple variable that can be used for version detection? I&amp;#39;m thinking of something like:&lt;/p&gt;
&lt;p&gt;if ( $psVersion -lt 2 )&lt;/p&gt;
&lt;p&gt; &amp;nbsp;{ &amp;#39;Powershell version must be 2 or greater&amp;#39; }&lt;/p&gt;
&lt;p&gt;else&lt;/p&gt;
&lt;p&gt; &amp;nbsp;{ &amp;#39;Processing x&amp;#39; }&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10036549" width="1" height="1"&gt;</description></item><item><title>re: Detection logic for PowerShell installation</title><link>http://blogs.msdn.com/b/powershell/archive/2009/06/25/detection-logic-poweshell-installation.aspx#9905724</link><pubDate>Sat, 10 Oct 2009 10:34:46 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9905724</guid><dc:creator>Ken</dc:creator><description>&lt;p&gt;How do we detect PowerShell 2.0 (but not 1.0) in a manner that won't break when PowerShell 3.0 is released?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9905724" width="1" height="1"&gt;</description></item><item><title>re: Detection logic for PowerShell installation</title><link>http://blogs.msdn.com/b/powershell/archive/2009/06/25/detection-logic-poweshell-installation.aspx#9820130</link><pubDate>Mon, 06 Jul 2009 19:39:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9820130</guid><dc:creator>cz9qvh</dc:creator><description>&lt;p&gt;FYI, the ps installer won't set HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\PowerShell\1\Insall = 1... so if your app is 32 bit and running on 64 bit windows then this method won't work.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9820130" width="1" height="1"&gt;</description></item><item><title>re: Detection logic for PowerShell installation</title><link>http://blogs.msdn.com/b/powershell/archive/2009/06/25/detection-logic-poweshell-installation.aspx#9805374</link><pubDate>Fri, 26 Jun 2009 15:46:15 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9805374</guid><dc:creator>PowerShell Team</dc:creator><description>&lt;p&gt;@Daniel - thanks. &amp;nbsp;Fixed now.&lt;/p&gt;
&lt;p&gt;Enjoy!&lt;/p&gt;
&lt;p&gt;Jeffrey Snover [MSFT]&lt;/p&gt;
&lt;p&gt;Distinguished Engineer&lt;/p&gt;
&lt;p&gt;Visit the Windows PowerShell Team blog at: &amp;nbsp; &amp;nbsp;&lt;a rel="nofollow" target="_new" href="http://blogs.msdn.com/PowerShell"&gt;http://blogs.msdn.com/PowerShell&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Visit the Windows PowerShell ScriptCenter at: &amp;nbsp;&lt;a rel="nofollow" target="_new" href="http://www.microsoft.com/technet/scriptcenter/hubs/msh.mspx"&gt;http://www.microsoft.com/technet/scriptcenter/hubs/msh.mspx&lt;/a&gt;&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9805374" width="1" height="1"&gt;</description></item><item><title>re: Detection logic for PoweShell installation</title><link>http://blogs.msdn.com/b/powershell/archive/2009/06/25/detection-logic-poweshell-installation.aspx#9804917</link><pubDate>Fri, 26 Jun 2009 10:28:35 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9804917</guid><dc:creator>Daniel</dc:creator><description>&lt;p&gt;Did you really spell PowerShell wrong in the article title!!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9804917" width="1" height="1"&gt;</description></item><item><title>re: Detection logic for PoweShell installation</title><link>http://blogs.msdn.com/b/powershell/archive/2009/06/25/detection-logic-poweshell-installation.aspx#9803656</link><pubDate>Thu, 25 Jun 2009 17:30:56 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9803656</guid><dc:creator>Pter</dc:creator><description>&lt;p&gt;And what should we use to test it VBScript? LOLL&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9803656" width="1" height="1"&gt;</description></item></channel></rss>