We can enable SSH & ESXi Shell using GUI or DCUI, but this time I want to show you easier way. Especially if you need to do so for more than single host. First thing we need to do is to connect to vcenter and select host that we want to operate on:
# Connect to vCenter instance
Connect-VIServer vCenterServer -user email@example.com -pass Pa$$w0rd
# Select host that you want to work on
$vmhost = "hostname.local"