Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $position = 0 #Create variable so that we can add an index to each item
- Get-ChildItem -Path .\Generated | #Get each file in the folder
- ForEach-Object { #creates a loop to work on each item that get-childitem finds
- $position++ #Add 1 for every item so that we can have multiple files
- Import-Csv .\Generated\MostRecentlyAccessed*.csv |
- Where-Object{$_.Filename -notlike "{*}{*}"} | #Remove filename junk
- Where-Object{$_.Filename -notlike "VM_*"} | #Remove filename junk - voicemails
- Where-Object{$_.Folder -notlike "*\AppData\*"} | #Remove folder junk - AppData
- Where-Object{$_.Folder -notlike "*\IntelGraphicsProfiles"} | #Remove folder junk - IntelGraphicsProfiles
- Where-Object{$_.Folder -notlike "*\xTools\*"} | #Remove folder junk - xTools
- Where-Object{$_.Folder -notlike "*RECYCLE.BIN*"} | #Remove folder junk - Recycling Bin
- Export-Csv .\Filtered\Filtered$position.csv -NoTypeInformation #Output to a new CSV file
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement