SHARE
TWEET

Untitled

a guest Sep 17th, 2019 99 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. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top