Linked by Thom Holwerda on Thu 25th Jan 2007 00:43 UTC
Microsoft "Once upon a time, when DOS walked the earth, the command line was the primary user interface for most of our computers. Then, Windows came along, and Microsoft seemed set on leaving the command prompt to dry up and wither into obscurity. Fortunately, Microsoft has again turned its attention to the command line and, in so doing, has produced one of the most compelling new Windows features eWEEK Labs has ever had the pleasure to test: Windows PowerShell."
Permalink for comment 205629
To read all comments associated with this story, please click here.
It looks like a pain to me
by Priest on Thu 25th Jan 2007 12:29 UTC
Member since:

Sure they whole passing oblects not text thing is a cool theory, but what does the syntax for the language actually look like?

Calculate the number of bytes in the files in a directory.

In powershell:
get-childitem | measure-object -property length -sum

In bash:
du -h

And it is not like the bash command is cryptic, du = "disk usage", the -h is not even required but it is the flag for "human readable", so you don't get an answer back in KB.

For some more interesting info check out the Powershell sctipts on Technet here:

The following script is designed to "List IP4 Route Table Information" (like route -p or netstat -r)

$strComputer = "."

$colItems = get-wmiobject -class "Win32_IP4RouteTable" -namespace "rootCIMV2" `
-computername $strComputer

foreach ($objItem in $colItems) {
write-host "Age: " $objItem.Age
write-host "Caption: " $objItem.Caption
write-host "Description: " $objItem.Description
write-host "Destination: " $objItem.Destination
write-host "Information: " $objItem.Information
write-host "Installation Date: " $objItem.InstallDate
write-host "Interface Index: " $objItem.InterfaceIndex
write-host "Mask: " $objItem.Mask
write-host "Metric 1: " $objItem.Metric1
write-host "Metric 2: " $objItem.Metric2
write-host "Metric 3: " $objItem.Metric3
write-host "Metric 4: " $objItem.Metric4
write-host "Metric 5: " $objItem.Metric5
write-host "Name: " $objItem.Name
write-host "Next Hop: " $objItem.NextHop
write-host "Protocol: " $objItem.Protocol
write-host "Status: " $objItem.Status
write-host "Type: " $objItem.Type

WOW, they reall made _that_ easier.

Reply Score: 5