Link to home
Start Free TrialLog in
Avatar of Alex
AlexFlag for United Kingdom of Great Britain and Northern Ireland

asked on

I'll learn this eventually and stop asking stupid questions

OK

Checking for a  service on 8000 tills, I'm therefore testing it on one till at the moment :-)

$Computers = Get-content "C:\Powershell Projects\TillSC\till.txt"

foreach ($computer in $computers) {Invoke-Command "SC \\$Computers Query Browser"
}

Open in new window


Error here

Invoke-Command : Parameter set cannot be resolved using the specified named parameters.
At C:\Powershell Projects\TillSC\SCQuery.ps1:3 char:36
+ ... mputer in $computers) {Invoke-Command "SC \\$Computers Query Browser"
+                            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (:) [Invoke-Command], ParameterBindingException
    + FullyQualifiedErrorId : AmbiguousParameterSet,Microsoft.PowerShell.Commands.InvokeCommandCommand

WHY DOESN'T THIS WORK

Cheers

Alex
ASKER CERTIFIED SOLUTION
Avatar of oBdA
oBdA

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Alex

ASKER

Ohhhhh god damn!!!

That's pretty, I like that, thank you :-)
Avatar of Alex

ASKER

Legend........................ Wait for it......................................dary!!!!!