Hi, I am trying to create a vm in a script I have been using for a long time. I upgraded PowerCLI and can no longer create a vm. I am creating the vm on premise, so I do not need any cloud capabilities. I am afraid now that I have a hybrid set of resources which are impacting the commands. Here is the list of resources, would someone please help? Thanks!
I am using ESXi 6.7 Update 1
ModuleType Version | Name | ExportedCommands | |
---------- ------- | ---- | ---------------- | |
Script | 6.7.0.11233116 VMware.DeployAutomation | {Add-DeployRule, Add-ProxyServer, Add-ScriptBundle, Copy-Depl... | |
Script | 6.7.0.11233116 VMware.ImageBuilder | {Add-EsxSoftwareDepot, Add-EsxSoftwarePackage, Compare-EsxIma... | |
Manifest 11.2.0.12780525 VMware.PowerCLI | |||
Script | 6.7.0.12483609 VMware.Vim | ||
Script | 11.2.0.12483642 VMware.VimAutomation.Cis.Core | {Connect-CisServer, Disconnect-CisServer, Get-CisService} | |
Script | 11.0.0.10379994 VMware.VimAutomation.Cloud | {Add-CIDatastore, Connect-CIServer, Disconnect-CIServer, Get-... | |
Script | 11.2.0.12483627 VMware.VimAutomation.Common | ||
Script | 11.2.0.12483638 VMware.VimAutomation.Core | {Add-PassthroughDevice, Add-VirtualSwitchPhysicalNetworkAdapt... | |
Script | 11.2.0.12483619 VMware.VimAutomation.Hcx | {Connect-HCXServer, Disconnect-HCXServer, Get-HCXAppliance, G... | |
Script | 7.6.0.12680098 VMware.VimAutomation.HorizonView | {Connect-HVServer, Disconnect-HVServer} | |
Script | 10.0.0.7893904 VMware.VimAutomation.License | Get-LicenseDataManager | |
Script | 11.2.0.12483633 VMware.VimAutomation.Nsxt | {Connect-NsxtServer, Disconnect-NsxtServer, Get-NsxtPolicySer... | |
Script | 11.2.0.12483635 VMware.VimAutomation.Sdk | {Get-ErrorReport, Get-PSVersion, Get-InstallPath} | |
Script | 11.0.0.10380515 VMware.VimAutomation.Security | {Get-SecurityInfo, Get-VTpm, Get-VTpmCertificate, Get-VTpmCSR... | |
Script | 11.2.0.12483605 VMware.VimAutomation.Srm | {Connect-SrmServer, Disconnect-SrmServer} | |
Script | 11.2.0.12483611 VMware.VimAutomation.Storage | {Add-KeyManagementServer, Copy-VDisk, Export-SpbmStoragePolic... | |
Script | 1.3.0.0 | VMware.VimAutomation.StorageUtility Update-VmfsDatastore | |
Script | 11.2.0.12483615 VMware.VimAutomation.Vds | {Add-VDSwitchPhysicalNetworkAdapter, Add-VDSwitchVMHost, Expo... | |
Script | 11.2.0.12483614 VMware.VimAutomation.Vmc | {Connect-Vmc, Disconnect-Vmc, Get-VmcSddcNetworkService, Get-... | |
Script | 10.0.0.7893921 VMware.VimAutomation.vROps | {Connect-OMServer, Disconnect-OMServer, Get-OMAlert, Get-OMAl... | |
Script | 6.5.1.7862888 VMware.VumAutomation | {Add-EntityBaseline, Copy-Patch, Get-Baseline, Get-Compliance... |
I reverted back to version 10.1.1.8827524. I found that the -template has to be placed after the -name in the new-vm command. However, now I am finding that after typing in a few parameters, Powershell is no longer resolving the next parameter I wish to use. That to me is an indication that the command is not expecting those parameters, but of course it is.
New-Vm -name $Servername -template $template -vmhost $servernamehost -Datastore $Datastore -OSCustomizationSpec $servernametemp -ErrorAction stop
Thanks for any help.
I assume you are talking about Intellisense?
Is that at the PS prompt, in the ISE, in Code...?
Which 'few parameters' did you type? You might be falling into a specific parameterset.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
yes, intellisense.
It is the only command that is not working in the script or even typed in manually.
It is also not working when I run the script within the Webcommander which I have been using for a long time.
It has also also failed on my local machine using no variables. The one thing that changed is that we did upgrade your 6 to 6.7 U1 Which caused me to upgrade powercli.
what do you mean, caught in a parameterset?
Thx!
The New-VM cmdlet has different parametersets, meaning you can't use all the possible parameters in any combination you want.
You can see the available parametersets when you do
Get-Command -Name New-VM -Syntax
The different 'paragraphs' you see in the output each represent a parameterset.
Some of the parameters that only appear in 1 parameterset can not be used in another parameterset.
The message you get seems to indicate that there aren't sufficient parameters given to allow the cmdlet to determine which parameterset is used.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference