Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $fileList = Get-ChildItem C:\Lab
- foreach ($item in $fileList){
- if ($item.length/1MB -lt 2){
- $item | Add-Member -MemberType NoteProperty -Name RarValue -Value "50000" -PassThru | Select FullName,RarValue
- }
- elseif ($item.length/1MB -lt 5){
- $item | Add-Member -MemberType NoteProperty -Name RarValue -Value "100000" -PassThru | Select FullName,RarValue
- }
- else {
- $item | Add-Member -MemberType NoteProperty -Name RarValue -Value "500000"-PassThru | Select FullName,RarValue
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement