I'm just starting out with scripting PowerShell for VMware products and I'm seeing some duplication in some of the calls. I figured I'd rather try and get a start in the "preferred" direction rather than learning bad habits.
To that end, I see there are a couple ways to create a new VM in PowerCLI. One is to call the New-VM commandlet and the other is to Initialize and specification and then call the Invoke-CreateVM call. The later two use the REST API and I imagine the New-VM call leverages these in the backend. But which is the preferred way we should do it in our scripts?