![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | Re: Creating array You don't need the $name var, you can point -Name to the $array index: $array = "test","test1","test2" $i = 0 while ($i -le 1) { $vm = New-VM -Name $array[$i] $i++ } ----- Shay Levi $cript Fanatic http://scriptolog.blogspot.com Hebrew weblog: http://blogs.microsoft.co.il/blogs/scriptfanatic Quote: > Thanks for the solution. > > I'm trying to implement this in the below loop (its uses a different > library) > > $i = 0 > while ($i -le 1) > { > $vm = New-VM -Name $name > $i++ > } > I'm trying to substitute the $name with test & test1 when $i = 0 & 1 > respectively. > > can you guide me. > |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Re: Creating array | PowerShell | |||
| Re: Creating array | PowerShell | |||
| Re: Creating array | PowerShell | |||
| Creating a byte array | PowerShell | |||
| Creating an array | PowerShell | |||