• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Sorting output in Ascending rather than Descending

J

j0seg

#1
Hi all,

Okay I've been doing some searches online, and also reading in my powershell
books, but I cant seem to find the command to sort in ascending, and I know I
can sort in Descending but when I enter sort-object -ascend or -asc I get an
error..but -desc seems to work...if I try to leave sort-object blank I also
get an error. So I figured I'd ask for a lil help...

Joseg
 

My Computer

S

Shay Levi

#2
There is no Ascending parameter on select-object, it's the default behavior.
What do you get for:

dir | sort

Can you see that the files are sorted in Ascending order?
Can you post your command?

-----
Shay Levi
$cript Fanatic
http://scriptolog.blogspot.com

> Hi all,
>
> Okay I've been doing some searches online, and also reading in my
> powershell books, but I cant seem to find the command to sort in
> ascending, and I know I can sort in Descending but when I enter
> sort-object -ascend or -asc I get an error..but -desc seems to
> work...if I try to leave sort-object blank I also get an error. So I
> figured I'd ask for a lil help...
>
> Joseg
>
 

My Computer

Users Who Are Viewing This Thread (Users: 1, Guests: 0)