Select and then Sort

May 29, 2008

  When you use both select-object and sort-object in a pipeline, what's the proper order? Let's check how fast they execute. Each speed test is built from two similar commands with a different sort/select piping order and each test is executed 10 times. The total execution time is measured in Milliseconds.   - Updated: 06/11/2008 (see comment below by Lee Holmes) -   Test #1 PS > (measure-Command { 1..10 | foreach { gsv | sort name | select name,status }}).TotalMilliseconds 444.5451 PS > (measure-Command { 1..10 | foreach { gsv | select name,status | sort name}}).TotalMilliseconds 384.7565 Result: Second command is...
no comments

Generating Random Dates

May 28, 2008

  One of the new cmdlets in PowerShell CTP2 is Get-Random. Get-Random gets a random number or selects objects randomly from a collection.  I wanted to generate random DateTime objects with it but there is no built-in capability for that, yet it doesn't mean you can't use Get-Random it to generate random dates :) At its base, a DateTime object is measured in 100-nanosecond units called Ticks. So I tried to use Get-Date to initialize a DateTime using Ticks. Again, Get-Date doesn't have any parameter for that so I checked the underlying object, System.DateTime. One of the...
no comments

Adobe Illustrator to XAML converter

  AI>XAML is plug-in, by Michael Swanson, that enables graphic designers to export vector artwork from Adobe庐 Illustrator庐 to WPF and Silverlight compatible XAML. It's free for download and there is also a video tutorial on Channel9. I need to try it in WPF forms! This week, the PowerShell blog sphere is full with WPF walk through's introduced by Joel, MoW and James Brundage from the PowerShell team.
tags:
no comments

PowerScripting Podcast – Episode 26

May 19, 2008

  PowerScripting Podcast - Episode 26 is out, this time with the legendary Keith Hill, Windows PowerShell MVP. You can also listen to the podacst online via PowerShell Community Toolbar.   And for a limited time, Quest, the sponsor of the PowerScripting Podcast is offering Powerscripting Podcast listeners a free copy of Jeffery Hicks upcoming book, 'Managing Active Directory with Windows PowerShell: TFM' from Sapien Press. Get the full details at the PowerScripting Podcast website.
no comments