I have 2 commands I am trying to combine into a single script and output as a CSV for a number of servers listed in a separate text file. I can get each working in a script by itself, but I'm pulling my hair out getting them to play nice together.
The first is:-
(Get-VM -name VMName | select ExtensionData).ExtensionData.config | Select Name, MemoryHotAddEnabled,
CpuHotAddEnabled |Export-csv -NoTypeInformation Output.csv
Second:-
#(Get-VM -name VMName) | select name -ExpandProperty Customfields | where{$_.Key -eq 'Last Backup'}|
select Name, Value |Export-csv -NoTypeInformation Output.csv
TIA,
Chris