I know that we can show the advanced setting for a VM by using the below command
Get-VM "VM_Name | Get-AdvancedSetting -Name isolation.tools.autoInstall.disable
My question is that I'm not able to export the output 😞
To what do you want to export, and how did you try to do it?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Get-VM |Get-AdvancedSetting -Name isolation.tools.dnd.disable | Export-Csv -Path .\Advanced_Settings.csv -NoTypeInformation
and I would like to export the vcenter name, vm name the parameter isolation.tools.dnd.disable if it's set to true or false
When that advanced setting is not set for a VM, the Get-AdvancedSetting cmdlet returns nothing.
So the snippet has to capture that, and return for example 'na' in that case.
Get-VM |
Select-Object -Property @{N = 'vCenter'; E = { ([uri]$_.ExtensionData.Client.ServiceUrl).Host}},
@{N='VM';E={$_.Name}},
@{N='isolation.tools.autoInstall.disable';E={
$adv = Get-AdvancedSetting -Entity $_ -Name 'isolation.tools.autoInstall.disable'
if($adv){$adv.Value}else{'na'}
}} |
Export-Csv -Path .\Advanced_Setting.csv -NoTypeInformation -UseCulture
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference