$VMlist =
Import-Csv -Path /temp/
5192020.csv -UseCulture | select -ExpandProperty Name
Get-VM -Name $VMlist | where {$_.PowerState -eq "PoweredOn"}
I have Name in my first column, first cell and the list of VM's below this in the .csv file I get this error.. Am I trying to use something that's been deprecated?
Get-VM -Name $VMlist | where {$_.PowerState -eq "PoweredOn"}
| ~~~~~~~
| Cannot validate argument on parameter 'Name'. The argument is null, empty, or an element of the argument collection contains a null value. Supply a collection that does not contain any null
| values and then try the command again.
Thanks..