Mar 16 2021 04:58 AM
PS C:\User> Get-VM -Name * | Select-Object -Property Name,State,CPUUsage | Export-Csv -Path E:\MYfolder/report.csv -NoTypeInformation #giving csv expected results alone
PS C:\User> Get-VMNetworkAdapter -Name * | Select-Object -Property MacAddress,IPAddresses | Export-Csv -Path E:\MYfolder/report.csv -NoTypeInformation #giving csv expected results alone
I am newly started my coding and stuck with building a PowerShell above script. How to write a single script to execute Get-VM and Get-VMNetworkAdapter with designated properties. Trying to Get VM information's from Hyper-V host or windows server. Output: should be a single csv file.
Mar 16 2021 06:42 PM