powershell - Setting file attribute on large volume (memory leak ?) -
I have this command running fine on more than 100 servers (2008 R2, PowerShell 2), a special Exclude the server and kills its memory (powerhell.exe consumes more than 6 GB RAM.)
Go- include the child's item - path E: \ Thumbs.db, " $ RECYCLE.BIN * "," ~ $ * "," System Volume Information "-Security-Force | Where {$ _. Features -notmatch "archive"} | % {$ _. Features [[System.IO.FileAttributes] :: Archive} Can anyone tell this? Is there a more efficient way to install the archive feature on about 200 GB-sized versions? Update It seems that this is the removed criminal parameter: I can see $ recycle.bin dir in processed files.
The problem is that if the get-childitem is then the -exclude parameter failed Will be launched at the root of the drive (the same problem on PS V3) Here's more details: Here's my bad solution:
$ Excluded = @ ('$ RECYCLE.BIN', 'System Volume Notification', 'Thumbs DDB') LS E: | ? {$ Excluded- $ _ name not found} |% {ls -recurse -force $ _. Fullname} |% {$ _. Features [[System.IO.FileAttributes] :: Archive} Unfortunately I can not use wildcards with it.
Comments
Post a Comment