PowerShell: List Files with Specific Attribute
List files that have certain attributes
use
-Attributes
param of
Get-ChildItem
.
# list file/dir with attribute hidden or system dir -Attributes hidden,system
You can combine any of the following attribute properties:
- Archive
- Compressed
- Device
- Directory
- Encrypted
- Hidden
- IntegrityStream
- Normal
- NoScrubData
- NotContentIndexed
- Offline
- ReadOnly
- ReparsePoint
- SparseFile
- System
- Temporary
Using these operators: (No space allowed, except after comma.)
!
(NOT)+
(AND),
(OR)
# list files that have certain attributes Get-ChildItem -Attributes !Directory+!System+Encrypted, !Directory+!System+Compressed