I am running the following code and on execution of the code I am getting an error.
$computers = Import-CSV 'C:\scripts\servers.txt'
foreach($computer in $computers)
write-host $computer.computername $computer.service $computer.operation
$objWMIService = Get-WmiObject -Class win32_service -computer $computer.computername -filter "name = '$($computer.service)'"
The error message tells me that $computer.computername
error text is as follows...
Cannot validate argument on parameter 'ComputerName'. The argument is null or empty. Supply an argument that is not null or empty and then try the
I have tried giving a value but am not understanding this..