Search code examples
powershellcompressed-folder

Locate Compressed files on servers


I would like to create a powershell script generating a report showing all compressed files/folders on remote servers. By compressed files I mean files compressed using the buildin Windows Compression utility, not zip. But I have a hard time figuring out how to localize the compressed files. Should I go with WMI or?

Thanks Frank


Solution

  • The FileInfo/DirectoryInfo classes from .NET (I assume all of this is easy available to PowerShell) will give you the file attributes that includes the compression attribute if compressed.