pool | desktop |
tst1 | rtyui |
tst2 | dfgty |
$test = import-csv C:\Users\tst\Desktop\pool.csv
$test1=@($test)
foreach($ts in $test1)
{
New-HVPool -InstantClone -PoolName "$ts.pool" -PoolDisplayName "$ts.pool" -Description "create testpoolps" -UserAssignment FLOATING -Vcenter vc.tst.com -ParentVM 'testvm' -SnapshotVM '12' -VmFolder 'Desktops' -HostOrCluster '11a' -ResourcePool 'Desktops' -NamingMethod PATTERN --Datastores 'D00893TB' -NamingPattern "$ts.desktop" -NetBiosName eentst -DomainAdmin root
}
Exception calling "Desktop_Create" with "2" argument(s): "ExceptionType : VMware.Hv.InvalidArgument
ErrorMessage : Invalid value for member
ParameterName : base.name"
At C:\Program Files\WindowsPowerShell\Modules\VMware.Hv.Helper\VMware.HV.Helper.psm1:4986 char:7
$id = $desktop_helper.Desktop_create($services,$desktopSpecObj)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Try replacing
"$ts.pool"
with
"$($ts.pool)"
Similar for $ts.desktop
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Try replacing
"$ts.pool"
with
"$($ts.pool)"
Similar for $ts.desktop
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Thanks .It works