Quantcast
Channel: PowerShell.org » All Posts
Viewing all articles
Browse latest Browse all 13067

Filtering based on calculated properties

$
0
0

Hi guys,

I have a new problem, where I got stuck:
I am generating a huge csv report, where I would like to remove a lot of rows. But there are so many, that Excel can’t handle them. So, I thought I might leave them out directly when generating the report.
So, here is a simplified example of what I do:

dir C:\ -recurse | Select Name,@{n="Size";e={$_.Length / 1MB}}

Now, how can I filter the results, so that I get only the files with the new property “Size” larger than 20 MB? The filter must look for the Size Property, not $_.Length
Or even more simplified: Can I apply “Where” after “Select”? I couldn’t manage to do it.


Viewing all articles
Browse latest Browse all 13067

Trending Articles