Advertisement
Guest User

Untitled

a guest
Sep 17th, 2019
161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $fileList = Get-ChildItem C:\Lab
  2. foreach ($item in $fileList){
  3.     if ($item.length/1MB -lt 2){
  4.         $item | Add-Member -MemberType NoteProperty -Name RarValue -Value "50000" -PassThru | Select FullName,RarValue
  5.     }
  6.     elseif ($item.length/1MB -lt 5){
  7.         $item | Add-Member -MemberType NoteProperty -Name RarValue -Value "100000" -PassThru | Select FullName,RarValue
  8.     }
  9.     else {
  10.         $item | Add-Member -MemberType NoteProperty -Name RarValue -Value "500000"-PassThru | Select FullName,RarValue
  11.     }
  12. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement