Guys,
I want to generate a report which will find any VM's which have any attached CD-ROM devices. I have created the following script
Get-VM | where{$_.ConnectionState -eq "True"} | Select Name | Export-Csv "C:\HealthCheck\SJDC\SJDC-ConnetedCD.csv" -NoTypeInformation
It generates the CSV file all right but its always empty. I made sure one of my VM's had an ISO image mounted and tried the script again, same result. Anyone know where I'm going wrong?
Thanks.
missing a parameter in there,try the below:
get-vm | where { $_ | Get-CDDrive | where { $_.ConnectionState.Connected -eq "true"}} | Select name | Export-Csv "C:\HealthCheck\SJDC\SJDC-ConnetedCD.csv" -NoTypeInformation
missing a parameter in there,try the below:
get-vm | where { $_ | Get-CDDrive | where { $_.ConnectionState.Connected -eq "true"}} | Select name | Export-Csv "C:\HealthCheck\SJDC\SJDC-ConnetedCD.csv" -NoTypeInformation