Turns off NTFS compression on a file/directory.
Disable-NtfsCompression [-Path] <String[]> [-Recurse] [-WhatIf] [-Confirm] [<CommonParameters>]
When disabling compression for a directory, any compressed files/directories in that directory will remain compressed. To decompress everything, use the -Recurse
switch. This could take awhile.
Uses Windows' compact.exe
command line utility to compress the file/directory. To see the output from compact.exe
, set the Verbose
switch.
Name | Type | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
Path | String[] | The path where compression should be disabled. |
true | true (ByValue, ByPropertyName) | |
Recurse | SwitchParameter | Disables compression on all sub-directories. |
false | false | False |
WhatIf | SwitchParameter | false | false | ||
Confirm | SwitchParameter | false | false | ||
CommonParameters | This cmdlet supports common parameters. For more information type Get-Help about_CommonParameters . |
Disable-NtfsCompression -Path C:\Projects\Carbon
Turns off NTFS compression on and decompresses the C:\Projects\Carbon
directory, but not its sub-directories/files. New files/directories will get compressed.
Disable-NtfsCompression -Path C:\Projects\Carbon -Recurse
Turns off NTFS compression on and decompresses the C:\Projects\Carbon
directory and all its sub-directories/sub-files.
Get-ChildItem * | Where-Object { $_.PsIsContainer } | Disable-NtfsCompression
Demonstrates that you can pipe the path to compress into Disable-NtfsCompression
.