New-VM Value cannot be null. Parameter name: source

The following error: “parameter name source cannot be null” is just an exception in the VMWare.VimAutomation.Core module.
With this error its hard to find the actual issue. The version i’ve running:

The actual issue is that there is no  “-NetworkName” or -PortGroup parameter is given. So adding this wil fix the issue.

Just curious so i updated the module to the newest available.
Updated VMware.VimAutomation.Core to version: 11.5
Now the error is more clear.

My test command:

Error: New-VM: PowerCLI could not automatically determine a network to which to attach the VM. Specify a network explicitly using the -NetworkName parameter.

In the newest PowerCli version the error is more clear.
Add a -NetworkName or -PortGroup to fix the error.

Happy Automating 🙂

Leave a reply

Your email address will not be published.