I am trying to import a CSV file and then sort by a colum. Cant seem to make it work.
$csvPath = 'path/to/usage_new.csv'
$usage = Get-Content -Path $csvPath | Select-Object -Skip 2 | Sort-Object "Percentage Used" | Out-String | ConvertFrom-Csv
foreach ($usage1 in $usage) {Write-Host Number $usage1.Phone used $usage1."Percentage Used"%}
This is just pretty basic but the Sort-Object does not work?
It imports and prints to screen OK
Any advice would be great!
Thanks