I'm trying to use a calculated property on Get-VM. I want to get the shortened version of the hostcluster property using split, but its not working. Here's an example of what I'm trying to do:
get-VMMserver -computername "VMM1"
get-VM | select computername, @{name="Host"; expression={($_.hostcluster.split("."))[0]}}