Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

Sorting an array fails

$
0
0

I have been trying to sort this array that I populate in run-time but it doesn't seem to sort.

What am I doing wrong here? Help please!!

 

foreach($k in $c)

{

 if($k.SideIndicator -eq "=>")

 {

     $tempCnt++

     $array+=$k.InputObject

 }

}

foreach($temp in $array | sort-object)

{

    $body+="<tr><td>" + $temp + "</td></tr>"

}

 

The out put I get is as follows:

\nas\copy
\\nas\coolx
\\nas\Line Guide
\\nas\DishTV
\\nas\dishmarker

Viewing all articles
Browse latest Browse all 6937

Trending Articles