< Back

Get-Duplicate

Mon Jan 13, 2020 8:14 pm

NAME Get-Duplicate



SYNOPSIS

A Powershell module that find duplicate files within a given folder.





SYNTAX

Get-Duplicate [-Path] <String> [-Recurse] [-Exclude <String>] [-Include <String>] [-ExcludeDirectory <String>]

[-Inverse] [-AsHashtable] [<CommonParameters>]



Get-Duplicate -LiteralPath <String> [-Recurse] [-Exclude <String>] [-Include <String>] [-ExcludeDirectory

<String>] [-Inverse] [-AsHashtable] [<CommonParameters>]



Get-Duplicate [-Recurse] [-Exclude <String>] [-Include <String>] [-ExcludeDirectory <String>] [-Inverse]

[-AsHashtable] [-InputObject <String>] [<CommonParameters>]





DESCRIPTION

A Powershell module that find duplicate files within a given folder. It may also expand it's search scope to all

descendent items of that folder.





PARAMETERS

-Path <String>

Folder to search for duplicate files.



Required? true

Position? 1

Default value

Accept pipeline input? false

Accept wildcard characters? false



-LiteralPath <String>

Folder to search for duplicate files.



Required? true

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Recurse [<SwitchParameter>]

Expand the scope of the duplicate file search to be across all descendent files of the given folder.



Required? false

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



-Exclude <String>

Omits the specified items. The value of this parameter qualifies the -Path parameter. Enter a path element or

pattern, such as "*.txt". Wildcards are permitted.



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Include <String>

Gets only the specified items. The value of this parameter qualifies the -Path parameter. Enter a path element

or pattern, such as "*.txt". Wildcards are permitted.



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-ExcludeDirectory <String>

Omits searching any descendent directory matching the entered name or pattern. Enter a name or pattern, such

as "*secret". Wildcards are permitted.



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Inverse [<SwitchParameter>]

Get only non-duplicate files. By default the Cmdlet returns duplicate files.



Required? false

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



-AsHashtable [<SwitchParameter>]

Get the result as a Hashtable, where duplicates are grouped in file hashes.



Required? false

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



-InputObject <String>

Parameter description



Required? false

Position? named

Default value

Accept pipeline input? true (ByValue)

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



OUTPUTS



NOTES





When using the -Recurse parameter, the md5 hash of each descendent file has to be calculated, in order for

comparison against all other descendent files' md5 hash.

Therefore, if using Get-Duplicate with the -Recurse parameter on a folder containing many large descendent

files,

it is to be expected that the Cmdlet might take several seconds to several minutes to complete, depending on

the

size of those files.



-------------------------- EXAMPLE 1 --------------------------



PS C:\\>Get-Duplicate -Path 'C:/my_folder_with_duplicates'













-------------------------- EXAMPLE 2 --------------------------



PS C:\\>Get-Duplicate -Path 'C:/my_folder_with_duplicates' -Recurse -ExcludeDirectory 'specialDirectory'















RELATED LINKS