How to Use -OutputMode Multiple PassThru

178 Views Asked by At

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

1

There are 1 best solutions below

1
PCTech On

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