Lucd Can you give me a powercli script to deploy Linux VMs using Excel file. When I am trying to deploy VMs using the below PowerCLI script its giving below error
Here is my PowerCLI script:
Import-Csv "C:\Users\sg0217865\Desktop\NewVMs.csv" -UseCulture | %{
Get-OSCustomizationSpec $_.Customization | Get-OSCustomizationNicMapping | Set-OSCustomizationNicMapping -IpMode UseStaticIP -IpAddress $_.ip
-SubnetMask $_.subnet -DefaultGateway $_.gw
$vm=New-VM -Name $_.Name -Template $_.Template -Host $_.Host -Datastore $_.Datastore -Confirm:$false -RunAsync | Set-VM -OSCustomizationSpec
$_.Customization
}