I'm having an issue running New-VM within a script where I read in a csv file to a set of variables and construct the new-vm command. Everything executes fine when a single disk is specified and the VM is created properly. If however more than a single disk is specified which the cmdlet says is acceptable with the new -DiskGB optional value separated by commas, the resulting VM is improperly built. When this is fed through the script it seemingly sends the correct string (-DiskGB 1,1) however it runs this to a [decimal] value dropping the comma and creating a single 11G disk. I can successfully run the new-vm command with the exact string I'm sending with the script in a powershell window and get the correct VM built. The issue seems to be with trying to automate it and I can't determine how to pass the disks variable so that it will be properly interpreted.
↧