Problem with Powershell script for vSpherePowerCLI

Hello

I am creating a script that clones of a VM environment VMware-model as much as I need.

I found a script online, that should do it:

____________________________________

SE connect-VIServer-Server 192.168.0.1

Get-VMHost

$host1 = "192.168.0.2".

$template = 'template1 '.

$datastore = "data1."

$customization = "templtest".

for ($i = 1; $i - 3; $i ++)

{

$tempvm = 'vServer -' + $i

$array += $tempvm

}

foreach ($vm in $array)

{

$vm = New - VM - name $vm - model $template - $host1 - $datastore - OSCustomizationSpec $customization data store host - confirm: $false

}

_____________________________

for example, this script should create 3 Template1 VMs with the names: vServer-1, vServer-2 and vServer3.

But it creates a virtual machine with the name vServer-1vServer-2vServer-3.

Can someone help me with this problem?

Is there something wrong in education for?

Thanks in anticipation,

Alex

Hi Alex,

Before the statement, you must insert the following line:

$array = @()

This will initialize the variable $array as an empty array.

Best regards, Robert

Post edited by: RvdNieuwendijk

Tags: VMware

Similar Questions

  • Are there any known problems with external battery for iPhone 6 s karim?

    Are there any known problems with external battery for iPhone 6 s karim? Jackery of input: 5V / 2. 1a.

    I had heard that some may damage internal parts of the phone.

    I am interested in what Apple says rather than what says karim.

    Thank you.

    Jkim99 wrote:

    Are there any known problems with external battery for iPhone 6 s karim? Jackery of input: 5V / 2. 1a.

    I had heard that some may damage internal parts of the phone.

    I am interested what said Apple rather than what it says karim.

    Thank you.

    There is no Apple here in this technical forum from user to user.

  • lately and I don't know why I see a pop up of a problem with the script. can some1 help me?

    There is a pop up of a problem with the script. He asked end and contuniue the script. I didn't have this problem before. Please help me this is getting really annoying. He asks a lot

    I changed a theme and almost never have a problem again...

  • I have a problem with my password for my MSN account.

    I'm having a problem with my password for Windows Live.  It does not recognize the sensitive passwords case.  I asked cela before and you refered me to Windows Live.  And I give them credit.  They tried several times to fix my problem and failed.  Then they refered back me to you.  And guess what, you refered me to Windows Live.  I'm stuck in limbo between you two.  CAN SOMEONE HELP ME WITH MY PROBLEM PLEASE?  PLEASE...  PRETTY PLEASE...

    This is a forum for issues relating to security, privacy and user for the Windows XP operating system accounts.

    Post Windows Live questions in the appropriate forum found here:
    http://windowslivehelp.com/

  • Cannot install Vista service pack 2 is 800f0a09 error code with the message that there are problems with the driver for dell latitude

    Original title: why I get error code 800f0a09 to upgrade to windows vista service pack 2

    I have a laptop del that is running on Windows Vista Edition Home Premium. I tried to download itunes but it requires service pack 2. Whenever I try to update to service pack 2, I get the message following error code 800F0A09. He also mentioned problems with the driver for dell latitude. What can I do to fix this please.

    Thank you

    Hello

    Please join Microsoft Community where you can find the necessary information on Microsoft products!

    You can not install Vista Service pack 2 and get the error with code 800f0a09 and the message that there are problems with the driver for dell latitude.

    The problem may occur if some of the components of the update are corrupt.

    What is the full error message that you receive?

    I suggest you follow the steps mentioned below to check if the problem is with the update components:

    Method 1: Reset the update components

    See the site:

    How to reset the Windows Update components?

    http://support.Microsoft.com/kb/971058

    Warning: This section, method, or task contains steps that tell you how to modify the registry. However, serious problems can occur if you modify the registry incorrectly. Therefore, make sure that you proceed with caution. For added protection, back up the registry before you edit it. Then you can restore the registry if a problem occurs. For more information about how to back up and restore the registry, click on the number below to view the article in the Microsoft Knowledge Base:

    http://Windows.Microsoft.com/en-us/Windows-Vista/back-up-the-registry

    Method 2: Run the system update readiness tool

     

    See the site:

    System update scan tool corrects errors of Windows Update in Windows 8, Windows 7, Windows Vista, Windows Server 2008 R2 and Windows Server 2008

    http://support.Microsoft.com/kb/947821

    Method 3: Turn off the antivirus software

     

    See the site:

    Disable the anti-virus software

    http://Windows.Microsoft.com/en-in/Windows-Vista/disable-antivirus-software

    Important note: Antivirus software can help protect your computer against viruses and other security threats. In most cases, you should not disable your antivirus software. If you need to disable temporarily to install other software, you must reactivate as soon as you are finished. If you are connected to the Internet or a network, while your antivirus software is disabled, your computer is vulnerable to attacks.

    I hope this helps. If the problem persists, let know us and we would be happy to help you.

  • my pc will not connect to wireless internet... It is said there could be a problem with the driver for the wireless network connection card

    connection network card

    my pc will not connect to wireless internet... It is said there could be a problem with the driver for the wireless network connection card... I'm not sure how to solve the problem of the dat

    Hello

    Did you change your computer?

    I suggest you to follow the links and check out them.

    The problems of Internet connection

    http://Windows.Microsoft.com/en-us/Windows-Vista/troubleshoot-Internet-connection-problems

    Solve problems, find wireless networks

    http://Windows.Microsoft.com/en-us/Windows-Vista/troubleshoot-problems-finding-wireless-networks

    Windows wireless and wired network connection problems

    http://Windows.Microsoft.com/en-us/Windows/help/wired-and-wireless-network-connection-problems-in-Windows

    Tips for solving common driver problems

    http://Windows.Microsoft.com/en-us/Windows-Vista/tips-for-fixing-common-driver-problems

  • Failed to perform recovery of factory setting - error 0x8007045D Code / product key error - "ERROR!" We encountered a problem with the request for approval.

    Original title: product key error

    Hi all...

    I have ' tried to download the disc Image of Windows 7 (ISO file), but when I insert my product key, the system cannot check it.
    I use the laptop Sony Vaio VPC EG35EG with preinstalled Windows 7 Home Basic 64 bit inside.
    Now, after that there is error (I cannot yet perform plant pose recovery; always finished with error 0x8007045D Code), I need to install clean my laptop with the USB or DVD Installer key. But then, when I try to download it, my product key (I found it on the sticker at the bottom of the laptop) are not validated by microsoft. It is said:

    "ERROR!" We encountered a problem with the request for approval.

    What should I do now? Y does it can someone help me?
    Thank you.

    Consider the following text:

    How to: What are my options for Windows 7 reinstall media?

    Make sure you scroll down and read the section:

    What to do if you cannot get your manufacturer recovery media, refuse to use or to buy it or the Microsoft Software Recovery Website does not work?

    also check:

    https://techingiteasy.WordPress.com/2012/04/13/how-to-activate-Windows-7-OEM-license-using-a-retail-disc/

  • Video device USB has a driver problem__ __There is a problem with the driver for USB video Device.__Device information __Name: __ID USB video device: USB\VID_05CA & PID_180C & MI_00\6 & 69C3BD0 & 0 & 0000 code __Error: 10 _ _ _

    I hava a dell inspiron 1440 with windows 7 and a a few days ago, my webcam was working just fine but know that it gives me this after troubleshooting

    Has a USB video device driver problem
    Not fixed
    There is a problem with the driver for USB video device. The driver must be reinstalled.
    The device information
    Name: USB video device
    ID: USB\VID_05CA & PID_180C & MI_00\6 & 69C3BD0 & 0 & 0000
    Error code: 10

    Hey laloo.16,

    As the error message states clearly that reinstalling the driver is required, please do the same. You can uninstall the driver that is currently installed from the Device Manager.
    To access Device Manager:
    1. go to start and type Device Manager.
    2. Select Device Manager in the control panel list.
    3. go to your device.
    4. to remove:
    Right-click on it and select Properties.
    5. Select the driver tab and click on uninstall to uninstall the existing driver.
    6. close Device Manager.
    Now go to the link below. Download the Dell WebCam software for your product.

    http://support.Dell.com/support/downloads/DriversList.aspx?OS=W732&CATID=-1&DateID=-1&impid=-1&OSL=en&typeid=-1&FormatID=-1&SERVICETAG=&SystemID=INSPIRON1440&hidos=WLH&hidlang=en&TabIndex =

    Please choose the appropriate version of Windows 7.  Install the driver and see if that brings your webcam to work.

    Kind regards

    Shinmila H - Microsoft Support

    Visit our Microsoft answers feedback Forum and let us know what you think.

  • There is a problem with the driver for a wireless adapter that if it is not compatible or not supported

    My grandmother came to visit me in Belgium and brought her laptop with her. It is Windows 7 and I bought in Ukraine. Thus, she cannot use wireless internet at my place. Troubleshooting scan says there is a problem with the driver for a wireless adapter that is it is not compatible or not supported, something like that. All sound systems are in Russian is not easy for me to explain it. Is it possible to fix this problem or she can't use her laptop to go on the net at all? Thank you!

    If it's a driver fault, can go you on another pc to work to manufacturers support web site for the 'Ukraine' pc and see if the wireless drivers are available there. If they are, download the latest compatible drivers for your pc and transfer them to it by a stick of memory from SD or USB and then install them.

    This may be due to a setting of your network security wireless, for example, that is your network is set to WPA2 but pc does not support. Check configurations for compatibility with your router wireless sound.

    See if anything here help - http://windows.microsoft.com/en-us/windows/setting-wireless-network#1TC=windows-7

    At worst, is it not possible to connect via a cable to your router, esp, if is only a visit to sound.

  • There is a problem with the driver for Canon PowerShot SD1200 IS. The driver must be reinstalled.

    There is a problem with the driver for Canon PowerShot SD1200 IS. The pilot
    must be reinstalled.

    Gerald

    To allow us to help you better, please provide as much detail as possible about the problem you are experiencing.


    If you design your question effectively, you can get good information from people who are familiar with the subject and who are happy to help you.

    Prepare your question. He thinks through. Hasty-survey questions get hasty responses, or none at all.

    What diagnosis have so far

    An effective question you will get help read faster how here
    Suggestions for asking for help on a site.
    http://www.CatB.org/~ESR/FAQs/smart-questions.html

    BTW, I see you have cross posted this on Technet

    http://social.technet.Microsoft.com/forums/Windows/en-us/a1bd86f2-6914-4cda-9e34-1e3abb75a33c/Canon-PowerShot-SD1200-is?Forum=tnfeedback

  • Having a problem with the script error message

    The error message and web page script error every move I make now. I tried to check and uncheck boxes tab in advance internet options. I also ran a check of the system that did not help either. Any suggestions? Thank you

    Hi Mic,

    From the description, it seems that you have a problem with the script error message in Internet Explorer.

    To better understand the question, please answer the following questions:

    1. is specific to a particular Web site question?

    2 have you made changes on the computer before this problem?

    3. What is the exact full error message and web page of script error message?

    4. When you get exactly the script error message and web page error message appears?

    5. what exactly you're talking about when you say "system check"?

    See the article mentioned:

    How to troubleshoot script errors in Internet Explorer

    http://support.Microsoft.com/kb/308260

    Hope the above information is helpful. If you have any question back to us, we are happy to help you.

  • Windows 8 "There is a problem with the driver for bluetooth hands-free audio"

    There is an X symbol by the sound icon, when clicked, it shows "There is a problem with the driver for the audio blue tooth hands-free". Troubleshooting has not been set, said that there is a bluetooth hands-free audio driver problem. In addition, when you look at the audio in Device Manager, error code 19 lights during all the points listed under ' audio, video and game controllers ".

    Hello

    Thanks for posting your question on the Microsoft community.

    We need more information about the issue so that we can help you better.

    What is the brand and model of your computer?

    Thank you for details on the question and your efforts to resolve.

    This problem may occur because of corrupted audio driver or settings.

    I suggest you run this Microsoft fixit and verify.
    Reference:
    Hardware devices do not work or are not detected in Windows
    https://support.Microsoft.com/en-us/mats/hardware_device_problems

    Automatically, he diagnoses and fixes problems with the hardware. Keyboard and mouse are not detected by the Manager of devices or when they do not work.

    I would also say that you uninstall and reinstall the sound drivers under "Audio, video and game controllers" and check.

    To uninstall the driver, please follow these steps:

    a. press Windows + R keys, type devmgmt.msc in the run window and press ENTER.

    b. Click to enlarge "Audio, video and game controllers", right click on the device, and then click Uninstall.

    c. restart the computer.

    Now, reinstall the drivers from the computer manufacturer's website and check the.
    Reference:
    http://Windows.Microsoft.com/en-us/Windows-8/all-drivers

    I hope this information helps.

    Please let us know if you need more help.

    Thank you

  • There is a problem with the driver for TSSTcorp DVD +-RW Drive SN - 208BB. The driver must be reinstalled.

    Hello
    With the help of the window - 8 installed on newly purchased Dell Inspiron notebook
    For a few days, I wasn't able to use my CD DVD drive because there is a driver problem, here's the trouble shoot report
    could someone help me how this issue be resolved
    TSSTcorp DVD +-RW Drive SN - 208BB has a driver problem fixed is not fixed
     
    There is a problem with the driver for TSSTcorp DVD +-RW Drive SN - 208BB. The driver must be reinstalled.
    Information InformationalDevice
    Name: TSSTcorp DVD +-RW Drive SN-208BB
    ID: SCSI\CDROM & VEN_TSSTCORP & PROD_DVD +-RW_SN-208BB\4 & BB94CF & 0 & 040000
    Error code: 19
     
    Reinstall the complete device driver
     
    There is a problem with the driver for TSSTcorp DVD +-RW Drive SN - 208BB. Reinstall the driver may resolve this issue.
     

    You can check the following registry key? :

    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\ {4D36E965-E325-11CE-BFC1-08002BE10318}

    To the registry for this key, in the right window, in the world is here, under 'Name', a LowerFilters and UpperFilters value?

    If so, for UpperFilters and LowerFilters, value which is listed under "data"?

  • There is a problem with the driver for Ralink Bluetooth PCIe Adapter. The driver must be reinstalled error code 39.

    HP Pavilion 17 laptop

    There is a problem with the driver for Ralink Bluetooth PCIe Adapter. The driver must be reinstalled.

    OT: Driver help

    Name: PCIe Ralink Bluetooth adapter
    Error code: 39

    Hello

    Thanks for posting the query on the Microsoft Community Forums. You have reached the right place. Let us work together to find the cause of this problem and try to solve.

    What is the number of full model of the laptop?

    39 error code means Windows cannot load the driver for this hardware device. The driver may be corrupted or missing. To resolve the problem, you will need to uninstall and reinstall the drivers for Ralink Bluetooth PCIe card on the manufacturer's Web site.

    I hope this helps. Let us know if you have other problems with Windows in the future.

  • Hello! I have a problem with the Simulator for android is not work. What is the reason?

    Hello! I have a problem with the Simulator for android is not work. What is the reason?

    Depending on your mobilde device you must first unlock the developer settings in order to test the AIR apps on it.

    Where to find these settings depends on your specific device.

Maybe you are looking for

  • A host server not able to take the update on the wsus Server

    I have 2012 production WSUS server in our environment. We deploy the wsus Server security patches, but there is a host that does not patch Server wsus rather take the patches from the Microsoft site directly. Can someone help me with this.

  • Want to m6-1105dx: editing adapter Wifi, replacing Atheros AR5B125 (something better). Adapter / compatible?

    Hi, need a m6-1105dx with a map of wifi Atheros AR5B125. need to upgrade the card for best wifi speeds and enjoy my Airport extreme 5 GHz band. Product # to the laptop: C2L91UA. I am running windows 10. So, what most recent wifi adapters and will be

  • Problem, the signals and Slots

    Hi, as I posted in one of my other posts I have following problem with signals and messages and would be nice if someone could clarify anything that I don't seem to be able to find what the problem of the outputs. I have the code: void MYNetworkClass

  • Cisco Aironet 1200

    Hi all If there is no link on the compatibility between Aironet 1200 and 3rd party Wireless LAN adapt? Thank you MAK

  • surface 2 Pro updated to win 8 to 8.1 Win question

    Hi, Windows 8.1 is not available in the store for me so I did a survey and ran this utility Microsoft online.  He said that I have a version 8 to win and to contact my system administrator to help upgrade business. My question is, who is my system ad