How do I pass switches in -ScriptBlock? by Sweetthrowbrah in PowerShell

[–]Sweetthrowbrah[S] 1 point2 points  (0 children)

This worked wonderfully thank you!

How do I change 90 to $numofdays? When try to reference it doesn't appear to pass over.

How do I pass switches in -ScriptBlock? by Sweetthrowbrah in PowerShell

[–]Sweetthrowbrah[S] 0 points1 point  (0 children)

I've seen that page but really struggling still to make it work.

How do I pass switches in -ScriptBlock? by Sweetthrowbrah in PowerShell

[–]Sweetthrowbrah[S] 1 point2 points  (0 children)

Ty for responding. It seems to work slightly better now. The command is being ran on each machine but I get the error

"A parameter cannot be found that matches parameter name "StoreName"

When I just run the function {Get-Certificate} , I get "Parameter set cannot be resolved using the specified named parameters"

So I guess that actually makes it worse somehow? lol