All Questions
Tagged with sorting powershell
12
questions
0
votes
1
answer
395
views
Powershell: sorting directories based on file count
I am attempting to create a list that counts the number of files in a folder and then sorts the order of the folders based on that count. I have the following but it doesn't work (i.e. doesn't sort):
...
1
vote
2
answers
1k
views
Powershell script Select sort output by number
The following powershell script outputs a server diskspace report.
Is there a way of sorting the 'Percent' data in either desc or asc order?
[Script]
$computers | ForEach {
$Disks = Get-WMIObject ...
0
votes
3
answers
2k
views
Windows Powershell: Get Items from directory -> md5 them -> sort list by filename -> out to file
Is there the way to complete mimic this unux command entirely by Windows Poweshell means, not with using the WSL:
find ./<dir1>/ -type f -exec md5sum {} + | sort -k 2 > dir1_hashes.md
I ...
0
votes
1
answer
410
views
How to output most common strings in a text file?
Background
I have a text file containing a list of databases and entries in those databases. Example text file:
Database 1
1. Book about abc.
2. Thesis about abc.
3. Book about xyz.
Database 2
1. ...
1
vote
1
answer
4k
views
Sorting output of Get-ADComputer efficiently
Powershell beginner here. I want to run a command in the terminal to list all the domain members of the specified domain with select properties, sorted by name. I have a domain with just under 400 PCs....
0
votes
2
answers
2k
views
Need Windows script to create folders named with file dates and move files to the matching folder
I need a CMD or Powershell script or batch file to
step through a list of files
make a folder named with the date of a file if it doesn't already exist, then
move that file into its matching ...
0
votes
1
answer
766
views
Possible to set default sort to "Type" in File Explorer using script?
Is there any way to automatically sort all files in Windows by TYPE as opposed to NAME?
Generally this is done by going to a folder, sorting by type, then going to the Ribbon, View, Options, View, ...
1
vote
2
answers
3k
views
How to sort right decimal numbers
I have a folder that contains sub-folders for each application version(decimal number). Now, I have a powershell script for version comparison. The problem is I can't sort it as expected. How can I ...
0
votes
1
answer
61
views
Copy photos taken between two time ranges
I am a student and photograph the blackboard often. I'm trying to sort my photos into folders, one folder for each class.
How could I copy all photos taken on Mondays and Wednesdays between 10:30 ...
1
vote
0
answers
447
views
Any way to do Linux-style sort --merge in Windows PowerShell?
In PowerShell, if I have two files that are already sorted and want to merge them into one big sorted file, it seems wasteful and inefficient to do gc file1, file2 | sort-object > newfile, ...
0
votes
2
answers
4k
views
Change the "modified date" of a folders (in possibly powershell)
From time to time, when I force-shutdown a Windows Server 2003 machine (I have no choice), the folders contained in a certain directory all change their 'modified date' to the current date.
Luckily, ...
2
votes
1
answer
11k
views
How can I sort objects by third column in Powershell?
I've a text file like this:
4108689096 2531 ./ssss/132432.odt
481446057 2293 ./abc/a.txt
3157353085 1096 ./dsjvbjf/c.docx
653380669 1824 ./bcd/x.avi
And I'd like to achieve in Powershell to sort the ...