- Local time
- 7:04 PM
- Posts
- 3,160
- OS
- Windows 11 Enterprise 25H2
Powershell:
function Get-DuplicateFile
{
param
(
[Parameter (Mandatory = $true)]
[string]$Path,
[Parameter (Mandatory = $false, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)]
[string]$Filter = '*.*'
)
begin
{
}
process
{
if (Test-Path -Path $Path)
{
Get-ChildItem -Path $Path -Filter $Filter -Force -Recurse -File -ErrorAction SilentlyContinue |
Group-Object -Property @('Length') | Where-Object { $_.Count -gt 1 } |
ForEach-Object {
$_.Group | Get-FileHash | Group-Object -Property @('Hash') | Where-Object { $_.Count -gt 1 }
}
}
}
end
{
}
}
My Computer
At a glance
Windows 11 Enterprise 25H2
- OS
- Windows 11 Enterprise 25H2






