VMware Cloud Community
cliffcahill
Enthusiast
Enthusiast
Jump to solution

Trimming esxcli values that are returned within Powercli

Hi guys,

Has anyone managed to Trim Value that is returned when running esxcli via powershell

For example

$myhost = get-vmhost -name esx01

$esxcli = Get-EsxCli -VMHost $myhost

$esxcli.system.coredump.network.get() | FT Enabled

Capture.JPG

I'm looking for Trim the Enabled ------- true - from the html output.

Capture.JPG

Any Idea?

Regards

Cliff

Tags (2)
0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

Not sure I get the question, but the output of the Get-EsxCli commands are objects.

Can't you just do ?

$myhost = get-vmhost -name esx01

$esxcli = Get-EsxCli -VMHost $myhost

$enabled = $esxcli.system.coredump.network.get() | Select -ExpandProperty Enabled


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

View solution in original post

0 Kudos
2 Replies
LucD
Leadership
Leadership
Jump to solution

Not sure I get the question, but the output of the Get-EsxCli commands are objects.

Can't you just do ?

$myhost = get-vmhost -name esx01

$esxcli = Get-EsxCli -VMHost $myhost

$enabled = $esxcli.system.coredump.network.get() | Select -ExpandProperty Enabled


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
cliffcahill
Enthusiast
Enthusiast
Jump to solution

Luc,

-ExpandProperty

I wasn't aware of this option. That worked perfectly.

Thank you.

Regards

Cliff

0 Kudos