<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Cupfighter.net &#187; PowerShell</title>
	<atom:link href="http://www.cupfighter.net/index.php/tag/powershell/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.cupfighter.net</link>
	<description>A blog by Schuberg Philis colleagues</description>
	<lastBuildDate>Thu, 09 Feb 2012 14:27:59 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<item>
		<title>Country Drink Tech-Ed 2009</title>
		<link>http://www.cupfighter.net/index.php/2009/11/country-drink-tech-ed-2009/</link>
		<comments>http://www.cupfighter.net/index.php/2009/11/country-drink-tech-ed-2009/#comments</comments>
		<pubDate>Fri, 13 Nov 2009 16:33:36 +0000</pubDate>
		<dc:creator>Patrick van den Berg</dc:creator>
				<category><![CDATA[Misc fun]]></category>
		<category><![CDATA[Opportunities]]></category>
		<category><![CDATA[Powershell]]></category>
		<category><![CDATA[TechEd]]></category>
		<category><![CDATA[Troubleshooting]]></category>
		<category><![CDATA[country drink]]></category>
		<category><![CDATA[Peter Beense]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[Russinovich]]></category>
		<category><![CDATA[Snover]]></category>
		<category><![CDATA[Tech-Ed]]></category>

		<guid isPermaLink="false">http://www.cupfighter.net/?p=773</guid>
		<description><![CDATA[Well, we had a great party last night! It was great seeing everyone was enjoying themselves. Of course a Dutch country drink would not be complete without some Dutch entertainment, Peter Beense gave a brilliant performance! Even some Tech-Ed speakers did attend even our Powershell dude Jeffrey Snover was spotted. Club restaurant Dante never hosted [...]]]></description>
			<content:encoded><![CDATA[<div><span style="font-size: small;font-family: Calibri"><span style="font-size: small;font-family: Calibri"><span style="font-size: small;font-family: Calibri"><span style="font-size: small;font-family: Calibri"><span lang="EN">Well, we had a great party last night!<br />
It was great seeing everyone was enjoying themselves. Of course a Dutch country drink would not be complete without some Dutch entertainment, Peter Beense gave a brilliant performance! Even some Tech-Ed speakers did attend even our Powershell dude Jeffrey Snover was spotted. Club restaurant Dante never hosted such great party before. <span style="font-family: Wingdings">J</span> Needless to say Schuberg Philis was happy to endorse and sponsor this event and hope we were able to explain that work hard play hard, is our kind of game. In other words, working here is as much fun you can have with your pants on.</p>
<p dir="ltr" align="left">You can check out the photos on:<br />
<a href="http://www.saycheese.eu/nl/events/2009/november/countrydrink"><span style="font-size: small;font-family: Calibri"><span style="font-size: small;font-family: Calibri"><span lang="EN">http://www.saycheese.eu/nl/events/2009/november/countrydrink</span></span></span></a></p>
<p dir="ltr" align="left">Today we closed the event with Case of the Unexplained&#8230; Windows Troubleshooting with Mark Russinovich.<br />
A really nice session over debugging and troubleshooting crappy apps and sluggish windows systems.<br />
Cool stuff every engineer should be able to use. We’ll digest all the tracks we’ve seen this week and post some more in the coming weeks. See you all next year!
</p>
<p dir="ltr" align="left">Cheers from Berlin!</p>
<p></span></span></span></span></span></div>
<div><span style="font-size: small;font-family: Calibri"><span style="font-size: small;font-family: Calibri"> </span></span></div>
<p><span style="font-size: small;font-family: Calibri"><span style="font-size: small;font-family: Calibri"> </p>
<p></span></span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.cupfighter.net/index.php/2009/11/country-drink-tech-ed-2009/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PowerShell V2 RTM has arrived&#8230;. also for Vista, XP and others</title>
		<link>http://www.cupfighter.net/index.php/2009/11/powershell-v2-has-arrived-also-for-vista-xp-and-others/</link>
		<comments>http://www.cupfighter.net/index.php/2009/11/powershell-v2-has-arrived-also-for-vista-xp-and-others/#comments</comments>
		<pubDate>Wed, 11 Nov 2009 11:41:55 +0000</pubDate>
		<dc:creator>Hans van Veen</dc:creator>
				<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Powershell]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[V2]]></category>
		<category><![CDATA[WinRM]]></category>

		<guid isPermaLink="false">http://www.cupfighter.net/index.php/2009/11/powershell-v2-has-arrived-also-for-vista-xp-and-others/</guid>
		<description><![CDATA[Late October PowerShell V2 was released for almost all Windows platforms. Check out http://support.microsoft.com/kb/968929 and download the version you need. Happy scripting!]]></description>
			<content:encoded><![CDATA[<p>Late October PowerShell V2 was released for almost all Windows platforms. Check out <a title="MS PowerShell" href="http://support.microsoft.com/kb/968929">http://support.microsoft.com/kb/968929</a> and download the version you need.</p>
<p>Happy scripting!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cupfighter.net/index.php/2009/11/powershell-v2-has-arrived-also-for-vista-xp-and-others/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PowerShell: Finding next available driveletter</title>
		<link>http://www.cupfighter.net/index.php/2009/06/powershell-finding-next-available-driveletter/</link>
		<comments>http://www.cupfighter.net/index.php/2009/06/powershell-finding-next-available-driveletter/#comments</comments>
		<pubDate>Tue, 30 Jun 2009 11:53:00 +0000</pubDate>
		<dc:creator>Hans van Veen</dc:creator>
				<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Powershell]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.cupfighter.net/?p=266</guid>
		<description><![CDATA[Finding the next available driveletter on a system, excluding reserved driveletters, can be done using the following PowerShell 1-liner. [char[]]&#8221;DEFGJKLMNOPQRTUVWXY&#8221; &#124; ?{!(gdr $_ -ea &#8216;SilentlyContinue&#8217;)} &#124; select -f 1 The character array containing only valid driveletters (in this example A, B, C, H, I, S and Z are not to be used)  is piped to the where-object cmdlet [...]]]></description>
			<content:encoded><![CDATA[<p>Finding the next available driveletter on a system, excluding reserved driveletters, can be done using the following PowerShell 1-liner.</p>
<p style="PADDING-LEFT: 30px"><span style="color: #0000ff;"><em>[char[]]&#8221;DEFGJKLMNOPQRTUVWXY&#8221; | ?{!(gdr $_ -ea &#8216;SilentlyContinue&#8217;)} | select -f 1</em></span></p>
<p>The character array containing only valid driveletters (in this example A, B, C, H, I, S and Z are not to be used)  is piped to the where-object cmdlet which uses Get-PSDrive to filter out the non-used drive letters. These are then passed to the Select-Object cmdlet which only displays the 1st match.</p>
<p>Beware: the line above returns only the bare driveletter &#8211; no colon is appended.</p>
<p><span style="color: #0000ff;"><em></em></span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.cupfighter.net/index.php/2009/06/powershell-finding-next-available-driveletter/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>PowerShell: Comparing Version numbers</title>
		<link>http://www.cupfighter.net/index.php/2009/06/powershell-comparing-version-numbers/</link>
		<comments>http://www.cupfighter.net/index.php/2009/06/powershell-comparing-version-numbers/#comments</comments>
		<pubDate>Wed, 24 Jun 2009 07:33:49 +0000</pubDate>
		<dc:creator>Hans van Veen</dc:creator>
				<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Powershell]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[Schuberg Philis]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.cupfighter.net/?p=209</guid>
		<description><![CDATA[Comparing version numbers can be tricky from time to time, before you know it you end up in auto-casting issues comparing strings to integers etc. The most common format of a version number in Windows is &#8220;Major. Minor. Build. Revision&#8221; where each individual item is a figure, but because of the separating dots PowerShell will treat [...]]]></description>
			<content:encoded><![CDATA[<p>Comparing version numbers can be tricky from time to time, before you know it you end up in auto-casting issues comparing strings to integers etc. The most common format of a version number in Windows is &#8220;Major. Minor. Build. Revision&#8221; where each individual item is a figure, but because of the separating dots PowerShell will treat each item as a string.</p>
<p>The .Net System.Version assembly offers a CompareTo method which can do the trick, as shown in the figure below.</p>
<p><img class="alignnone size-full wp-image-210" title="versions" src="http://www.cupfighter.net/wp-content/uploads/2009/06/versions.jpg" alt="versions" width="637" height="309" /></p>
<p>The CompareTo method will return 1, 0 or -1  depending whether the compare to version  is higher, equal or lower.</p>
<p><span style="color: #0000ff;">Thanks to Shay Levi (see the comment) I now know a better/faster method for comparing version numbers (thaks Shay). PowerShell has its own [vesion] type. This removes the need of loading the assembly and using New-Object. It still allows for using the CompareTo method and direct compare via -ge, -gt, etc.</span></p>
<p><span style="color: #0000ff;"><img class="alignnone size-full wp-image-227" title="versions-2" src="http://www.cupfighter.net/wp-content/uploads/2009/06/versions-2.jpg" alt="versions-2" width="624" height="321" /></span></p>
<p><span style="color: #0000ff;">The CompareTo method will distinguish between the 3 possibilities (&gt;, &lt; or =), but direct comparison might be sufficient in a script.</span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.cupfighter.net/index.php/2009/06/powershell-comparing-version-numbers/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>PowerShell: Controlling Cmdlet parameters</title>
		<link>http://www.cupfighter.net/index.php/2009/06/powershell-controlling-cmdlet-parameters/</link>
		<comments>http://www.cupfighter.net/index.php/2009/06/powershell-controlling-cmdlet-parameters/#comments</comments>
		<pubDate>Mon, 22 Jun 2009 13:52:19 +0000</pubDate>
		<dc:creator>Hans van Veen</dc:creator>
				<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Powershell]]></category>
		<category><![CDATA[cmdlet]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[Schuberg Philis]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.cupfighter.net/?p=167</guid>
		<description><![CDATA[PowerShell allows for inline parameter control for some of its cmdlet parameters. Based upon commandline and/or inputfile content you might want to turm some of the cmdlet parameters on or off. For example: scripts manipulating files will often use the Get-ChildItem cmdlet in combination with the -recurse parameter, but not allways the subfolder files are required. Instead [...]]]></description>
			<content:encoded><![CDATA[<p>PowerShell allows for inline parameter control for some of its cmdlet parameters. Based upon commandline and/or inputfile content you might want to turm some of the cmdlet parameters on or off.</p>
<p>For example: scripts manipulating files will often use the Get-ChildItem cmdlet in combination with the -recurse parameter, but not allways the subfolder files are required. Instead off having multiple Get-ChildItem commandlines (each with their own set of parameters) a single line might be possible.</p>
<p>The following examples use the Get-ChildItem cmdlet to show what I mean.</p>
<p>The command in figure below will display all *.tmp files in the current folder and its subfolders.</p>
<p><img class="alignnone size-full wp-image-170" title="image11" src="http://www.cupfighter.net/wp-content/uploads/2009/06/image11.bmp" alt="Get-ChildItem without parameter control" width="552" height="226" /></p>
<p>By extending -recurse with :$false recursive lookup will be turned off.</p>
<p><img class="alignnone size-full wp-image-173" title="image2" src="http://www.cupfighter.net/wp-content/uploads/2009/06/image2.bmp" alt="Get-ChildItem with recures lookup turned off" width="557" height="213" /></p>
<p>On the otherhand, replacing $false with $true will turn recursive lookup on again.</p>
<p>So using a boolean variable we can turn recursive lookup on or off from within the script (-recurse:$RecurseOnOff). And of course this method also works for other parameters.</p>
<p><img class="alignnone size-full wp-image-174" title="image3" src="http://www.cupfighter.net/wp-content/uploads/2009/06/image3.bmp" alt="Get-ChildItem with multiple controls" width="556" height="238" /></p>
<p>And it does get stranger&#8230;.. in some occasions you can also reverse the default action of a parameter. Hence the following figure.</p>
<p><img class="alignnone size-full wp-image-175" title="image4" src="http://www.cupfighter.net/wp-content/uploads/2009/06/image4.bmp" alt="Reverse parameter action" width="560" height="195" /></p>
<p>The 1st command will show all files with exception of the *.tmp files. By appending :$false to -exclude, we turn -exclude into -include as demonstrated by the 2nd command.</p>
<p>This form of parameter manipulation offers a scala of possibilities. Using script parameters to control cmdlet behaviour can both decrease script size and complexity.</p>
<p>Have fun experimenting with this little trick</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cupfighter.net/index.php/2009/06/powershell-controlling-cmdlet-parameters/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

