Author Posts

August 28, 2018 at 3:17 pm

Hello, I'm new to PS and looking to past an array of items to Get-AuthenticodeSignature.

The exception which is likely obvious to you.

Get-ChildItem : The input object cannot be bound to any parameters for the command either because the command does not

take pipeline input or the input and its properties do not match any of the parameters that take pipeline input.

$files = @("C:\two.exe.exe","C:\one.exe") | Get-ChildItem $files | ForEach-object {Get-AuthenticodeSignature $_}

Thank you

August 28, 2018 at 3:19 pm

Yep! Try something like this:

$Files = @("C:\one.exe") | Get-AuthenticodeSignature

Should do the trick.

Alternatively, if you want to iterate through all files in a directory, you could still use Get-ChildItem –

$Files = @("C:\OneDir\") | Get-ChildItem -File -Recurse | Get-AuthenticodeSignature

August 28, 2018 at 4:55 pm

Above reply by James will server you requirement, I just wanted to add one more point.

If you are having PowerShell version < 3.0 , -File switch parameter is not available. You will have to filter using Where-Object cmdlet.

$Files = @("C:\OneDir\") | Get-ChildItem -File -Recurse | Where-Object -FilterScript { -not $_.PSIsContainer} | Get-AuthenticodeSignature

August 28, 2018 at 4:58 pm

Please ignore above post, there is some issue in code posting as footers became part of post and I'm not able to edit it.

Above reply by James will server you requirement, I just wanted to add one more point.
If you are having PowerShell version < 3.0 , -File switch parameter is not available. You will have to filter using Where-Object cmdlet.

$Files = @("C:\OneDir\") | Get-ChildItem -File -Recurse | Where-Object -FilterScript { -not $_.PSIsContainer} | Get-AuthenticodeSignature

Note: PS version 2.0 is no more recommended and supported by Microsoft due to various securty concerns.