0

I keep getting an error when I run this code. It is from this website http://woshub.com/find-duplicate-files-powershell/

$file_dublicates | Out-GridView -Title "Select files" -OutputMode Multiple –PassThru | Remove-Item –Verbose –WhatIf

Out-GridView : Parameter set cannot be resolved using the specified named parameters.
****************** At *.ps1:17 char:20
+ ... ublicates | Out-GridView -Title "Select files" -OutputMode Multiple – ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (:) [Out-GridView], ParameterBindingException
    + FullyQualifiedErrorId : AmbiguousParameterSet,Microsoft.PowerShell.Commands.OutGridViewCommand

$file_dublicates | Out-GridView -Title "Select files" -OutputMode Multiple –PassThru | Remove-Item –Verbose –WhatIf

PCTech
  • 19
  • 4

1 Answers1

0

It worked when I changed it to this: $Links = $File_dublicates | Out-GridView -Title "Test" –PassThru

PCTech
  • 19
  • 4
  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Nov 11 '22 at 07:39