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

WIMMount (HSM) causing cluster storage to go redirected (2012r2 DC)

Failed to delete the test record dcdiag-test-record in zone test.com

Azure MFA with Azure AD and RDS