Hello everyone, I’m new to the forum
I’m studying Powershell
I have a problem that will surely be stupid, but I don’t understand:
PS C:\> Get-Content c:\tmp\DC.txt
srvfindc01
srvfindc02
srvfindc03
srvfindc04
PS C:\> Get-WmiObject win32_operatingsystem -ComputerName (Get-Content c:\tmp\DC.txt) -AsJob
Get-WmiObject : Cannot validate argument on parameter 'ComputerName'. The argument is null or empty. Provide an argument that is not null or empty, and then try the
command again.
At line:1 char:51
+ ... ratingsystem -ComputerName (Get-Content c:\tmp\DC.txt) -AsJob
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidData: (:) [Get-WmiObject], ParameterBindingValidationException
+ FullyQualifiedErrorId : ParameterArgumentValidationError,Microsoft.PowerShell.Commands.GetWmiObjectCommand
PS C:\>
Why?