Search code examples
powershellpowercli

Can I remove the title completely?


Is there a method how I can remove the License title?

This is part of my command in my script:

Get-VMHost -Name test.test.local | Select LicenseKey

Output:

LicenseKey

----------  

M023J-ZYH06-88Y88-078RK-CR47M

I want to remove the "LicenseKey" title


Solution

  • Use -ExpandProperty -

    Get-VMHost -Name test.test.local | Select -ExpandProperty LicenseKey
    

    OR

    (Get-VMHost -Name test.test.local).LicenseKey