<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://powershell.com/cs/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>Power Tips - All Comments</title><link>http://powershell.com/cs/blogs/tips/default.aspx</link><description /><dc:language>en</dc:language><generator>CommunityServer 2008.5 (Build: 30929.2835)</generator><item><title>re: Bulk-Changing File Extensions</title><link>http://powershell.com/cs/blogs/tips/archive/2010/08/11/bulk-changing-file-extensions.aspx#14468</link><pubDate>Tue, 07 Feb 2012 20:55:52 GMT</pubDate><guid isPermaLink="false">f421715f-7aba-45f0-8a8d-44de5318a3a7:14468</guid><dc:creator>dbump</dc:creator><description>&lt;p&gt;I wasn&amp;#39;t able to get the script to recurse subfolders, as written.&lt;/p&gt;
&lt;p&gt;It worked fine when using an explicit include parameter, and moving the wildcard exension to that parameter:&lt;/p&gt;
&lt;p&gt;Dir $home\ -Recurse -Include &amp;quot;*.ps1&amp;quot; | .....&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://powershell.com/cs/aggbug.aspx?PostID=14468" width="1" height="1"&gt;</description></item><item><title>re: Create Own Driver Tool</title><link>http://powershell.com/cs/blogs/tips/archive/2012/01/13/create-own-driver-tool.aspx#14258</link><pubDate>Tue, 31 Jan 2012 00:10:17 GMT</pubDate><guid isPermaLink="false">f421715f-7aba-45f0-8a8d-44de5318a3a7:14258</guid><dc:creator>turtlenorthwest</dc:creator><description>&lt;p&gt;I took this a step further to sort by Start Mode, then Display Name. &amp;nbsp;&lt;/p&gt;
&lt;p&gt;Driverquery.exe /v /FO CSV | ConvertFrom-Csv | Select-Object &amp;#39;Display Name&amp;#39;, &amp;#39;Start Mode&amp;#39;, &amp;#39;Paged Pool(bytes)&amp;#39;, Path | Sort-Object &amp;#39;Start Mode&amp;#39;, &amp;#39;Display Name&amp;#39; | Out-GridView&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://powershell.com/cs/aggbug.aspx?PostID=14258" width="1" height="1"&gt;</description></item><item><title>re: Convert to Numeric</title><link>http://powershell.com/cs/blogs/tips/archive/2012/01/18/convert-to-numeric.aspx#14084</link><pubDate>Thu, 19 Jan 2012 02:11:58 GMT</pubDate><guid isPermaLink="false">f421715f-7aba-45f0-8a8d-44de5318a3a7:14084</guid><dc:creator>Brent Challis</dc:creator><description>&lt;p&gt;An extension to this is to check that the input can be cast. &amp;nbsp;This can be done by wrapping the cast in a try/catch block or by using the TryParse method of the numeric data classes such as:&lt;/p&gt;
&lt;p&gt;$snumber = (Read-Host &amp;#39;Enter a number&amp;#39;)&lt;/p&gt;
&lt;p&gt;[Double]$number = 0&lt;/p&gt;
&lt;p&gt;if ([Double]::TryParse($snumber,[ref] $number))&lt;/p&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt;	$number * 12&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;else&lt;/p&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt;	Write-Output &amp;quot;Not a Number&amp;quot;&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://powershell.com/cs/aggbug.aspx?PostID=14084" width="1" height="1"&gt;</description></item><item><title>re: Create Own Driver Tool</title><link>http://powershell.com/cs/blogs/tips/archive/2012/01/13/create-own-driver-tool.aspx#14009</link><pubDate>Fri, 13 Jan 2012 15:59:53 GMT</pubDate><guid isPermaLink="false">f421715f-7aba-45f0-8a8d-44de5318a3a7:14009</guid><dc:creator>willsteele</dc:creator><description>&lt;p&gt;Some of these tips go outside the div and I have to check the page source to see the whole tip. &amp;nbsp;Is there a way to wrap the content on these one liners?&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://powershell.com/cs/aggbug.aspx?PostID=14009" width="1" height="1"&gt;</description></item><item><title>re: Replace Text in Files</title><link>http://powershell.com/cs/blogs/tips/archive/2010/06/18/replace-text-in-files.aspx#13870</link><pubDate>Wed, 04 Jan 2012 21:56:43 GMT</pubDate><guid isPermaLink="false">f421715f-7aba-45f0-8a8d-44de5318a3a7:13870</guid><dc:creator>PowerShellPunk</dc:creator><description>&lt;p&gt;I have been working on this problem all day. Thank you for posting this helpful information.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://powershell.com/cs/aggbug.aspx?PostID=13870" width="1" height="1"&gt;</description></item><item><title>re: Wait For Key Press</title><link>http://powershell.com/cs/blogs/tips/archive/2009/07/08/wait-for-key-press.aspx#13843</link><pubDate>Tue, 03 Jan 2012 13:52:46 GMT</pubDate><guid isPermaLink="false">f421715f-7aba-45f0-8a8d-44de5318a3a7:13843</guid><dc:creator>Russ77</dc:creator><description>&lt;p&gt;brutalSelect,&lt;/p&gt;
&lt;p&gt;You may have gotten the error because you included the outside quotation marks.&lt;/p&gt;
&lt;p&gt;Only paste this into your shell window:&lt;/p&gt;
&lt;p&gt;$x = $host.UI.RawUI.ReadKey(&amp;quot;NoEcho,IncludeKeyDown&amp;quot;)&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://powershell.com/cs/aggbug.aspx?PostID=13843" width="1" height="1"&gt;</description></item><item><title>re: Creating a "Better" More</title><link>http://powershell.com/cs/blogs/tips/archive/2011/12/26/creating-a-quot-better-quot-more.aspx#13836</link><pubDate>Mon, 02 Jan 2012 17:11:41 GMT</pubDate><guid isPermaLink="false">f421715f-7aba-45f0-8a8d-44de5318a3a7:13836</guid><dc:creator>flaphead</dc:creator><description>&lt;p&gt;I get the same as jbruns2010 when I paste the function in to powershell and press Q&lt;/p&gt;
&lt;p&gt;Command halted by user.&lt;/p&gt;
&lt;p&gt;At line:15 char:39&lt;/p&gt;
&lt;p&gt;+ &amp;nbsp; process { $steppablePipeline.Process &amp;lt;&amp;lt;&amp;lt;&amp;lt; ($_) }&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;+ CategoryInfo &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;: InvalidOperation: (:) [], RuntimeException&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;+ FullyQualifiedErrorId : MethodInvocationException&lt;/p&gt;
&lt;p&gt;I put the code into my profile.ps1&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://powershell.com/cs/aggbug.aspx?PostID=13836" width="1" height="1"&gt;</description></item><item><title>re: Creating a "Better" More</title><link>http://powershell.com/cs/blogs/tips/archive/2011/12/26/creating-a-quot-better-quot-more.aspx#13747</link><pubDate>Tue, 27 Dec 2011 13:12:40 GMT</pubDate><guid isPermaLink="false">f421715f-7aba-45f0-8a8d-44de5318a3a7:13747</guid><dc:creator>jbruns2010</dc:creator><description>&lt;p&gt;The original post creates a boat load of these errors when pressing the Q key,&lt;/p&gt;
&lt;p&gt;Object reference not set to an instance of an object.&lt;/p&gt;
&lt;p&gt;At \\corpsoftware\nt$\Scripts\PowerShell\Functions\more.ps1:16 char:37&lt;/p&gt;
&lt;p&gt;+ process { $steppablePipeline.Process &amp;lt;&amp;lt;&amp;lt;&amp;lt; ($_) }&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;+ CategoryInfo &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;: InvalidOperation: (:) [], RuntimeException&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;+ FullyQualifiedErrorId : MethodInvocationException&lt;/p&gt;
&lt;p&gt;The revised one above, does not produce the errors when Q is pressed, but it does not drop you to a PS prompt. &amp;nbsp;You get a blank line but Ctrl-C is needed to drop you out of the more.ps1.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://powershell.com/cs/aggbug.aspx?PostID=13747" width="1" height="1"&gt;</description></item><item><title>re: Creating a "Better" More</title><link>http://powershell.com/cs/blogs/tips/archive/2011/12/26/creating-a-quot-better-quot-more.aspx#13740</link><pubDate>Mon, 26 Dec 2011 12:24:06 GMT</pubDate><guid isPermaLink="false">f421715f-7aba-45f0-8a8d-44de5318a3a7:13740</guid><dc:creator>pfm</dc:creator><description>&lt;p&gt;The more function fails with a stream of errors. Putting try/catch in the process and end blocks, like so, seems to fix it...&lt;/p&gt;
&lt;p&gt; process { try { $steppablePipeline.Process($_) } catch { return }}&lt;/p&gt;
&lt;p&gt; end { try { $steppablePipeline.End() } catch {} }&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://powershell.com/cs/aggbug.aspx?PostID=13740" width="1" height="1"&gt;</description></item><item><title>re: Reading Registry Values</title><link>http://powershell.com/cs/blogs/tips/archive/2009/11/25/reading-registry-values.aspx#13499</link><pubDate>Tue, 06 Dec 2011 18:00:13 GMT</pubDate><guid isPermaLink="false">f421715f-7aba-45f0-8a8d-44de5318a3a7:13499</guid><dc:creator>skiddle</dc:creator><description>&lt;p&gt;Thanks for the tip! I noticed a typo:&lt;/p&gt;
&lt;p&gt;Get-RegistryValue &amp;#39;HKLM:\Sofware\Microsoft\Windows NT\CurrentVersion&amp;#39; should be&lt;/p&gt;
&lt;p&gt;Get-RegistryValue &amp;#39;HKLM:\Software\Microsoft\Windows NT\CurrentVersion&amp;#39;&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://powershell.com/cs/aggbug.aspx?PostID=13499" width="1" height="1"&gt;</description></item><item><title>re: Print All PDF Files in a Folder</title><link>http://powershell.com/cs/blogs/tips/archive/2011/03/01/print-all-pdf-files-in-a-folder.aspx#13419</link><pubDate>Tue, 29 Nov 2011 18:48:16 GMT</pubDate><guid isPermaLink="false">f421715f-7aba-45f0-8a8d-44de5318a3a7:13419</guid><dc:creator>Bryan Price</dc:creator><description>&lt;p&gt;Also, it&amp;#39;s -Path, not -FilePath.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://powershell.com/cs/aggbug.aspx?PostID=13419" width="1" height="1"&gt;</description></item><item><title>re: Store Pictures in Active Directory</title><link>http://powershell.com/cs/blogs/tips/archive/2011/11/28/store-pictures-in-active-directory.aspx#13412</link><pubDate>Tue, 29 Nov 2011 07:18:10 GMT</pubDate><guid isPermaLink="false">f421715f-7aba-45f0-8a8d-44de5318a3a7:13412</guid><dc:creator>Trondhindenes</dc:creator><description>&lt;p&gt;You don&amp;#39;t have to save to bitmap first, it&amp;#39;s easier to just store the jpg as byte directly:&lt;/p&gt;
&lt;p&gt;$photo = [byte[]](Get-Content $($PicFileName) -Encoding byte)&lt;/p&gt;
&lt;p&gt;regards, &lt;/p&gt;
&lt;p&gt;Trond&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://powershell.com/cs/aggbug.aspx?PostID=13412" width="1" height="1"&gt;</description></item><item><title>re: Turning Multi-Value WMI Properties into Text</title><link>http://powershell.com/cs/blogs/tips/archive/2011/11/24/turning-multi-value-wmi-properties-into-text.aspx#13375</link><pubDate>Fri, 25 Nov 2011 07:08:08 GMT</pubDate><guid isPermaLink="false">f421715f-7aba-45f0-8a8d-44de5318a3a7:13375</guid><dc:creator>Lumir Kunath</dc:creator><description>&lt;p&gt;How can I see missing code cuted by right side of text box &amp;nbsp;of this power Tip ?&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://powershell.com/cs/aggbug.aspx?PostID=13375" width="1" height="1"&gt;</description></item><item><title>re: Changing Units</title><link>http://powershell.com/cs/blogs/tips/archive/2011/11/16/changing-units.aspx#13261</link><pubDate>Wed, 16 Nov 2011 17:14:01 GMT</pubDate><guid isPermaLink="false">f421715f-7aba-45f0-8a8d-44de5318a3a7:13261</guid><dc:creator>LucD</dc:creator><description>&lt;p&gt;Great solution.&lt;/p&gt;
&lt;p&gt;If you combine this with my method from my Friendly Units post (&lt;a rel="nofollow" target="_new" href="http://www.lucd.info/2011/11/06/friendly-units/"&gt;www.lucd.info/.../friendly-units&lt;/a&gt;), you get the best fit (and still sortable).&lt;/p&gt;
&lt;p&gt;dir $env:windir | &lt;/p&gt;
&lt;p&gt;Select-Object Mode, LastWriteTime, Length, Name | &lt;/p&gt;
&lt;p&gt;ForEach-Object { &lt;/p&gt;
&lt;p&gt;	if ($_.Length -ne $null) {&lt;/p&gt;
&lt;p&gt;		$_.Length = $_.Length | Add-Member ScriptMethod ToString {&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;		$Units = &amp;quot;B&amp;quot;,&amp;quot;KB&amp;quot;,&amp;quot;MB&amp;quot;,&amp;quot;GB&amp;quot;,&amp;quot;TB&amp;quot;,&amp;quot;PB&amp;quot;,&amp;quot;EB&amp;quot;,&amp;quot;ZB&amp;quot;,&amp;quot;YB&amp;quot;&lt;/p&gt;
&lt;p&gt;			$modifier = 0&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;		if($this -gt 0){&lt;/p&gt;
&lt;p&gt;				$modifier = [math]::Floor([Math]::Log($this,1KB))&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;		}&lt;/p&gt;
&lt;p&gt;			(&amp;#39;{0,7:f2} {1,2}&amp;#39; -f ($this/[math]::Pow(1KB,$modifier)),&lt;/p&gt;
&lt;p&gt;			(&amp;amp;{if($modifier -lt $units.Count){$units[$modifier]}&lt;/p&gt;
&lt;p&gt;				else{&amp;quot;1KB E{0}&amp;quot; -f $modifier}}))&lt;/p&gt;
&lt;p&gt;		} -Force -pass&lt;/p&gt;
&lt;p&gt;	};$_} | Sort-Object Length&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://powershell.com/cs/aggbug.aspx?PostID=13261" width="1" height="1"&gt;</description></item><item><title>re: Extracting Icons</title><link>http://powershell.com/cs/blogs/tips/archive/2011/09/26/extracting-icons.aspx#13086</link><pubDate>Sat, 05 Nov 2011 14:48:58 GMT</pubDate><guid isPermaLink="false">f421715f-7aba-45f0-8a8d-44de5318a3a7:13086</guid><dc:creator>Archdeacon</dc:creator><description>&lt;p&gt;Just a query about the &amp;#39;Extract Icon&amp;#39; recent PowerShell tip published here: this&lt;/p&gt;
&lt;p&gt;works fine but I do not get the actual icon displayed in Explorer, just a default&lt;/p&gt;
&lt;p&gt;image. Am I missing something simple here, as other 32 x 32 type ico files are&lt;/p&gt;
&lt;p&gt;displayed correctly?&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://powershell.com/cs/aggbug.aspx?PostID=13086" width="1" height="1"&gt;</description></item></channel></rss>
