How do I set the compress bit for a file using a PS script?


how set compress bit file using ps script?  i'd to compress files in folder with a script like gci | compress-item (made up).

thank you.

as quick way set ntfs compression (not zip), i'll use compact.exe command in powershell. example:

  $cmd = "compact.exe /c /s:myfile.txt" cmd /c $cmd   



Windows Server  >  Windows PowerShell



Comments

Popular posts from this blog

Generating Event ID 91, 44 with CA (In Event Viewer with source as Certsvc)

Group policy default policy cannot be edited because network name not found

Problem when changing update source