New hard drive doesn't work is not for me

I have to delete and automatically add the existing disks to virtual machines. The removal works, but for some reason, I can't New-hard drive to work. Here is how I call it and the result:

> $drVm

Name PowerState Num CPU memory (MB)
----                 ---------- -------- -----------
Test-VM 1 2048 PoweredOff


> $drPath

[ds_name]  VM-name/VM - Name.vmdk


> New-disk-hard - VM $drVM - DiskPath $drPath

New-HDD: 15/05/2012 11:10:33 New-disk hard no. datastore corresponding found.
On line: 1 char: 13
+ New hard drive < < < < - VM $drVm - DiskPath $drPath
+ CategoryInfo: ObjectNotFound: (:)) [new-harddisk], VimException)
+ FullyQualifiedErrorId: Client20_VirtualDeviceServiceImpl_NewVirtualHardDisk_DatastoreNotFound, VMware.VimAutomation.ViCore.Cmdlets.Commands.VirtualDev
ice. NewHardDisk


> Get-Datastore-name "ds_name.

Name FreeSpaceMB CapacityMB
----                               -----------      ----------
16335 16384 ds_name

Values and types appear to be correct, but it does not work. At one point, I had this working but then stopped. I had recently upgraded to v5 PowerCLI so I supported that, but it still does not work.

I am passing the VM as a virtual machine type and the path of the disk as a string by the docs.

Any help would be appreciated. Especially if I'm doing something stupid. It is such a simple function.

I thought as well

The virtual machine can be a VM object or even a string with the name of the virtual machine. The functionality of the object by name (NVOS) will ensure that the hard drive New cmdlet retrieves the virtual computer object. And Yes, the path is a string.

If you assign the hard drive manually, then do a Get-hard drive, you see the same way that you use in your script?

Tags: VMware

Similar Questions

  • I got my product key Windows 7 enabled on my computer, then my hard drive crashed, so I had to reinstall Windows on a new hard drive. He is now not letting me turn it back on.

    original title: activation problem

    -I got my product key Windows 7 enabled on my computer, then my hard drive crashed, so I had to reinstall Windows on a new hard drive.  He is now not letting me turn it back on.  What should I do?  I don't want my computer or Microsoft thinks I use a version of Windows

    It is Windows 7 Home Premium, and I my here in front of me activation code.  But it is to say that it is not valid.

    Skip entering your product key Windows 7 and complete the installation.

    When you reach the desktop, click Start, right-click on computer

    Click on properties

    Scroll down to the Windows Activation

    Click the link x days before activation.

    Click on the link that says: "show me other ways to activate.

    Enter the product key

    Click next

    Select the Activation of the phone

    Click Next when you enter your key page

    Select your country

    Click Next, call the number listed

    Be sure to explain your situation to the Appeals Officer.

    Provide the installation generated when ID requested by the call agent

    They give a confirmation ID in return, enter it

    Click next to complete the activation.

    However, the requirements for the media upgrade is that you have an operating system already eligible such as Windows XP or Vista installed to use it. Since the Windows 7 end user license agreement.

    15 UPDATES. To use upgrade software, you must first be licensed for the software that is eligible for the upgrade. After the upgrade, this agreement takes the place of the agreement for the software that you upgraded. After upgrade, you can no longer use the software that you upgraded.

    So, if you are always denied, you will just have to reinstall Windows XP or Vista and let it do the verification of eligibility.

  • I have always used the windows logo + L key to lock my computer, I remove things from my hard drive and now it locks not for me... need your help :)

    I have always used the windows logo + L key to lock my computer, I remove things from my hard drive and now it locks not for me... need your help :)

    Hi ddbowers01,

    The other shortcut keys work?

    Try pressing CTRL + ALT + DELETE and then try to lock the computer and check.

    Check the setting below:

    a. in the Control Panel, click user accounts.

    b. click on change the way users log on or off the power.

    c. Click to uncheck use the screen of welcome for a quick and easy connection.

    d. click OK.

    With regard to:

    Samhrutha G S - Microsoft technical support.

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

  • New hard drive and CMD R does not work

    Hello

    My old hard drive crashed while I bought a new one.  I tried restoring the internet and it goes through the process, but I just get the apple logo that stays for hours.  Can someone point me in the correct direction.  I am assumeing that I need to make disk utility but I can't seem to him so that I can format the drive.  I also have a snow leopard but startup disk that gets the same results of just the apple logo.

    reset the SMC, PRAM and NVRAM on your MBP

    http://www.Macworld.com/article/2881177/how-to-reset-your-Macs-NVRAM-pram-and-SM c.html

    How to reset memory NVRAM (or LANDAU)

    If your Mac does not start properly or one of the functions listed in the previous section is strange, you can perform a simple reset of your Mace NVRAM or PRAM. Your Mace NVRAM or PRAM reset Resets the data stored on its default setting. (Note: as always, we strongly recommend having a full backup of your important data before troubleshooting your Mac.)

    The process to reset the PRAM and NVRAM is exactly the same thing. Just follow these steps:

    (1) turn off your Mac.

    (2) (2) tourner turn on your Mac, and when you hear the ringtone to start, immediately press and hold the Command-Option-P-R keys. (Note: you can use a wired keyboard to reset).

    (3) holding the keys until the Mac restarts and you hear the startup chime for the second time, and then release the keys.

    After resetting the NVRAM or PRAM, you may need to reconfigure some of your settings of Mace. If you're still having problems with your Mac, you may want to consider resetting the SMC.

    What is SMC?

    On Macs with Intel processors, SMC is system management controller. The SMC chip controls your function of sleep Mace, various lights and indicators, speed of the fan and keyboard backlight power among other things. So if your fan Mace is out of whack, lights are misconduct, he answer correctly when the lid is closed, or the Mac not turn on at all, you might want to reset the SMC. (Note: again, be sure to have a full backup of your important data before resetting the SMC)

    How to reset the SMC in a MacBook with a non-removable battery

    (1) stop the Mac.

    (2) connect your power adapter to your Mac and a power source.

    (3) with the Mac turned off, press shift-control-Option and press the power button at the same time.

    (4) release all the keys and turn on your Mac.

  • NEW HARD DRIVE DOESN'T HAVE A SEATOOLS TEST

    I posted the 3/22 on having missing NTLDR. Joel suggested the Seatools and it turned out to be a bad hard drive. Replaces and I tried recovery with a set of newly purchased recovery disks. Recovery did not work, I was told I needed work for drives cd-rom drive to work. Just put in the new rom but the recovery still does not work. It says it's from recovery, but does nothing. Very quiet PC and no action on the drive light. I tried the Seatools and it failed the short test. I don't know if it's software/driver error or pilot error.

    Hi Joel,

    Sorry for the confusion. Re-reading the post looks that I speak in square circles. I was on my way to the door when I decided to make the post, just got back. The disk set is new. I got it computer surgeons, a third-party provider, exclusively for HP/Compaq recovery kits. I got for them through HP. HP initially sent me the wrong set, when I contacted them on this matter, they said that they no longer have the number build for my pc.  The guy at computer surgeons is one that says that I need a cd rom to work to perform a recovery, the multi media player would not work. It always seems strange to me. I did the Seatools test you advised on the first HARD disk, I had and he failed. The place where I had sent me another. He said that he would go several tests on her before shipment to make sure it was ok, and if I still had a problem it was probably the discs. I got this drive yesterday and it included the results of Seatools test with it. After installing it I ran again the Seatools. I wanted to make sure it was ok before I did anything. If something went wrong, I knew that I could not blame the HARD drive. Hope this clears it a bit for you.

    UPDATE: HANG THE FLAG! Issued either solved!  I tried the recovery discs again but this time I hit retry on two mistakes, that I continue to do - cannot recover, recover Windows 32 and couldnot, creator of tools. I gave up after several retrys who kept popping up but has not left the installation. I am in the process now of to update and delete.

  • New hard drive in Windows XP does not recognize

    So I got a Windows XP SP and I want to connect an external hard drive. It does not recognize the hard drive but do not appear in my computer as Samsung (i). This just appeared once. But now, whenever I have connected to the computer again, he appeared as removable disk (e :)) and I can not delete all the files in there.) I tried to use the add hardware, but he found nothing and is not solve this problem.

    And if it serious, my computer is slow. Thanks for any help.

    Hello

    You are welcome!

    Good to know that the problem is solved. Let us know if you need assistance related to Windows and we will be happy to help you.

  • the 'new folder' button doesn't work is not on the documents or images.

    The "new folder" documents or pictures button does not work. When I press nothing happens.   Used to work, but no more.

    Only change I made is that I now use Chrome instead of IE. How can I fix it?

    It's looking like a recent update of chromium may be the cause. Here are two patches.
     

    How to remove and restore the default context Menu items 'New' in Windows 7 and Windows 8
    http://www.SevenForums.com/tutorials/28677-new-context-menu-remove-restore-default-menu-items.html
     
     
     
    Tip: When you save the text in Notepad, the default file format is .txt. Replace all files.

     
  • Touchscreen doesn't work is not for the Satellite U920t - 10 p

    Please read this completely before you answer with your copied and pasted answers.

    My touch screen lets you stop work, but was still attached with a reboot of the machine.
    Now it doesn't work at all and * I've tried everything posted elsewhere in this forum *.

    I tried to change the settings for battery power, try to update the drivers (not exactly who is right though!).

    Please can anyone help because it is a new machine and it's very frustrating.

    Serial number: 7D054633H
    Model: Toshiba Satellite U920t - PSUL1E-01900JEN 10 p

    Thanks in advance.

    > Please read this completely before you answer with your copied and pasted answers.
    IMHO, I n t think that someone here in the forum doesn t read the messages before playback
    I hope that this part of your post is just the result of frustration due to the malfunction of the notebook...

    Back to your question:
    > I tried everything already posted elsewhere in this forum.
    and what does this mean? What have you tried exactly?
    Have you given zero and plant control panel?

    If not try and in the case where this help not the laptop's hardware could be affected which requires new checks of material by an authorized

  • Windows product key doesn't work is not for the reinstallation of Windows 7

    So my Lenovo (B560) became super slow and I want to wipe the hard drive and reinstall Windows 7. But when I looked on the Microsoft Web site and tried to check my key I received the following message is displayed:

    "The product key you have entered seems to be the software that was preinstalled by the manufacturer of the device. Contact the manufacturer of the device for software recovery options.

    The product key that I used was the COA sticker under the laptop which was indeed different from one I receovered from the register. In any case, I tried both and none worked.

    Ideas for how can I proceed?

    You must install OEM Lenovo recovery disks or a recovery partition to use the key.

  • New tab shortcut doesn't work does not correctly

    I've upgraded to Firefox 4 yesterday. When I only have one tab open, by pressing the keyboard shortcut for a new tab (Ctrl + T), nothing happens. The same happens when I have several tabs open, but the first (leftmost) path is selected. If other is selected, control + T works fine.

    You have this problem when running in Firefox SafeMode?
    A troubleshooting mode.

    1. you can open the Firefox 4.0 SafeMode hold the SHIFT key when you use the desktop Firefox or shortcut in the start menu.

    2. or use the Help menu option, click restart with the disabled... modules while Firefox is running.

    To exit safe mode of Firefox, simply close Firefox and wait a few seconds before using the shortcut of Firefox to open it again.

    If this is not the case, see this:

    http://support.Mozilla.com/en-us/KB/troubleshooting+extensions+and+themes

  • USB 3.0 flash drives doesn't work is not on the USB 2.0 in windows 7

    My kingston USB 3.0 does not no flash drives or supported on USB 2.0 in windows 7 and 'The window error' occurred: Windows found driver software for your device, but has encountered an error trying to install.

    Hi Faisal,.

    What is the brand and model of the computer?

    You will need installed USB 3.0 drivers on the manufacturer's Web site work with the USB 3.0 flash drives.

    Try the methods provided below and see if they help to resolve the issue.

    Method 1:

    This problem occurs because the USB 3.0 device is not completely inserted in the port.

    The USB 3.0 supports the devices USB 1.0, 2.0 and 3.0. The first layer of pins inside the USB connector are for USB 1.0 and 2.0 ports. The second layer of pins inside the USB connector is USB 3.0 ports. Therefore, to resolve this problem, make sure that the USB 3.0 device is inserted in the port.

    Method 2:

    Uninstall and reinstall the USB drivers and check if it helps.

    To remove and reinstall all USB controllers, follow these steps:

    (a) click Start, run, type sysdm.cpl in the Open box and then click OK.

    (b) click on the Hardware tab.

    (c) click on the button Device Manager.

    (d) expand Bus USB controllers.

    (e) each device under the node Bus USB controllersright click and then click Uninstall to remove them one at a time.

    (f) restart the computer and reinstall the USB controllers.

    (g) connect the removable USB storage device and perform a test to ensure that the problem is solved.

    We know the results.

  • New folder option doesn't work does not and then right-click new folder option missing.

    "New folder" option in windows Explorer 7 does nothing when selected.  Right click menu is not a "new folder" option.  Can someone help me?

    You are welcome.

  • New ITunes update doesn't work does not correctly on computer

    I had a version of itunes on my computer, it gave me the opportunity to upgrade to the latest version, but when finished installing it will open any

    Hello eldoxy24,

    Have you checked the article Apple listed here to see if this will help to solve your problem of iTunes.
    iTunes for Windows in Windows Vista does not open after upgrade - http://support.apple.com/kb/TS2363

    Please let us know if that helps.

    Sincerely,

    Marilyn
    Microsoft Answers Support Engineer
    Visit our Microsoft answers feedback Forum and let us know what you think

  • WiFi doesn't work is not for the Satellite A215-S7437

    I just reinstalled windows 7 thin on my Toshiba Satellite A215-S7437 computer laptop PSAFGU - 00L 002 and the wifi does not work.

    I tried a bunch of drivers on your website and they either do not work or are not compatible.

    I even tried engineering driver to install a driver flash as you guys suggested someone else on these forums and.

    Please help as I am in desperate need of wifi on my laptop.

    Hello

    According to the data sheet for laptop, the Satellite A215-S7437 supports Realtek 802. 11b / g wireless LAN

    Please visit this page to get the WLan drivers:
    http://APS2.toshiba-tro.de/WLAN/

    You will find different Realtek Wlan drivers.
    I have not quite what Realtek chip you have exactly, but this isn't a big problem to discover this m.

    Check in the Device Manager: it is useful HowTO
    [How to identify an unknown device (e.g. LAN wireless module)? | http://forums.computers.toshiba-europe.com/forums/ann.jspa?annID=78]

  • FN + F8 doesn't work is not for the Satellite L650

    I just reinstall the system to windows 7 ultimate 64 bit and already install the wlan driver and package.

    "In the Device Manager,"broadcom network adapter wlan"card works very well, but he can't find any available wireless network since ' fn + f8" is missing or does not.

    Someone at - not how to solve this problem?

    Hello

    Other FN keys work correctly?
    As far as I know that you will install VAP and Support of Flash Card Utility to get the FN keys to work!
    Please check this!

    In addition, the WLan driver must be installed in order to get the FN + F8 key combination.
    Usually, that's all you need

Maybe you are looking for