Disable-NtfsCompression

Turns off NTFS compression on a file/directory.

Syntax

Disable-NtfsCompression [-Path] <String[]> [-Recurse] [-WhatIf] [-Confirm] [<CommonParameters>]

Description

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.

Related Commands

Parameters

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.

EXAMPLE 1

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.

EXAMPLE 2

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.

EXAMPLE 3

Get-ChildItem * | Where-Object { $_.PsIsContainer } | Disable-NtfsCompression

Demonstrates that you can pipe the path to compress into Disable-NtfsCompression.