-Confirm the $false Set-hard drive breaks

I am working on a script to expand the hard disk in vsphere automatically and then enter in the guest operating system and lay it there as well.  I want this script to automate completely and I don't want the confirmation message is displayed.  My problem is on this line.

Get-disk hard - vm $hostname | where {$_.name - eq 'Disk 1'} | Together-hard drive - CapacityKB $value - confirm $false

The thrown error is

Together-hard drive: cannot bind parameter 'hard drive '. Cannot convert value 'False' t
type 'VMware.VimAutomation.ViCore.Types.V1.VirtualDevice.HardDisk' of the o. Error: "I."
nvalid typecast 'System.String' ' VMware.VimAutomation.ViCore.Types.V1.Virt
ualDevice.HardDisk'. »
C:\users\prat294\Documents\test2.ps1:34 tank: 80
+ $temp = get-disk hard - vm $compname | where {$_.name - eq $harddisk} | Together-Har
dDisk < < < <-CapacityKB $newValue - confirm $false
+ CategoryInfo: InvalidArgument: (:)) [game-hard drive], ParameterBi)
ndingException
+ FullyQualifiedErrorId: CannotConvertArgumentNoMessage, VMware.VimAutomat
ion.ViCore.Cmdlets.Commands.VirtualDevice.SetHardDisk

It interprets the $false as a reference to hard drive.  I tried this:

$temp = get-disk hard - vm $hostname | where {$_.name - eq "Disk 1"}

Together-hard drive - HDD $temp - CapacityKB $value - confirm $false

The error I get here is different.

Together-hard drive: cannot bind parameter 'Persistence' of the target. The exception set
Ting 'Persistence': ' invalid value passed for the parameter of persistence. " THE AV
cover values are: persistent, no persistent, cancellable, IndependentPersistent, Ind
ependentNonPersistent, unknown. »
C:\users\prat294\Documents\test2.ps1:35 tank: 14
+ Game-hard drive < < < <-disk hard $temp - CapacityKB $newValue - confirm $false
+ CategoryInfo: WriteError: (:)) [game-hard drive], ParameterBinding)
Exception
+ FullyQualifiedErrorId: ParameterBindingFailed, VMware.VimAutomation.ViCo
re.Cmdlets.Commands.VirtualDevice.SetHardDisk

I then added an indicator of persistence, but he then requested a flag of data store.  I added that, and then he said: there is no positional parameter to False.

I'm starting think it that the - confirm flag is broken, but I would get a few additional entries.  Thanks for your help.

I think you should use

Get-disk hard - vm $hostname | where {$_.name - eq 'Disk 1'} | Together-hard drive - CapacityKB $value - confirm: $false

Here's how to pass a value to a switch parameter.

If you have a gap between the two, the cmdlet will be interpreted as a new value of the parameter ($false in this case), but he does not know what parameter value should go.

Tags: VMware

Similar Questions

  • Question about the cmdlet set-hard drive

    Hi out there,.

    I would like to move a group of new data warehouses vmdk using the cmdlet set-hard drive.

    But I want to start moving just a svmotion operation at a time.

    How could I get the id of the task of the vcenter svmotion operation initiated by game-hard drive, so that I can use wait-job to wait to complete the svmotion operation to start the following?

    any idea of... tips are welcome...

    concerning

    Hello

    Welcome to the VMware communities.

    The cmdlet Set - hard drive doen't have a parameter - RunAsync, as for example, the Move-VM cmdlet. This means that the each hard drive Set command must finish before the next command can begin. To this effect, you don't have to perform the synchronization of tasks yourself when you use the cmdlet Set-hard drive.

    Best regards, Robert

  • expand the disk error using the cmdlet set-hard drive

    Hello

    I will try to extend a vmdk with the command set-hard drive the rcli installed to my latptop througth, but I'm getting some sort of syntax error, I think.

    I connect the vCenter and can run commands very well...

    I use the following commands in the process:

    PS C:\ > get-disk hard-vm xxx_teco

    CapacityKB persistence Filename
    ----------                     -----------                                                    --------
    persistent 31457280 [brjgs163_Storage1_Local] xxx_teco/xxx_teco.vmdk
    persistent 5242880 [brjgs163_Storage1_Local] xxx_teco/xxx_teco_1.vmdk

    then:

    PS C:\ > set-hard drive - vm xxx_teco - hard drive ' [brjgs163_Storage1_Local] xxx_teco/xxx_teco_1.vmdk "-capcity 10485760

    then, got the error:

    Together-hard drive: Nao e possible associar o Parâmetro 'hard drive '. NAO e possible Converter "[brjgs163_Storage1_Local]" o valor homes don't do tipo "System.String" no type "VMware.VimAutomation.Types.HardDisk".
    Em linha:1 caractere:36 + set-hard drive - vm xxx_teco - hard disk < < < < [brjgs163_Storage1_Local] xxx_teco/xxx_teco_1.vmdk - capcity 10485760
    + CategoryInfo: InvalidArgument: (:)) [game-hard drive], ParameterBindingException)
    + FullyQualifiedErrorId: CannotConvertArgumentNoMessage, VMware.VimAutomation.Commands.SetHardDisk

    I have tryied somehow different to specify the disk hard but without success... always get these errors of messages...

    any help, please.

    The cmdlet Set-HDD wants something, such that returned by Get - hard drive to the hard drive setting.

    Easier is to use the pipeline (see also example 1 on the hard disk-Get help).

    get-disk hard - vm xxx_teco | where {$_.} {Name - eq ' Hard disk 2 "} | whole-disk hard-capcity 10485760


  • How to set the password for HARD drive?

    Hello

    Could someone help me please by setting the password for TOSHIBA STOR. E ART 3 (1 TB 2.5 ") HARD DRIVE?

    Hello

    I n t have this external HARD disk, but Toshiba pre-installed some additional software on this subject for the creation of HARD drive password?

  • Together-hard drive breaks down when the resizing of the IDE

    Hi all

    I'm trying to resize a thin provisioned IDE drive using the following command:

    * Set-hard drive - HDD (Get-disk hard - VM myVm) - CapacityKB (37 * 1024 * 1024) *.

    However, I get the following error message when you try to do:

    Invalid operation for the device '0'

    The maximum size that works is 8GB (8 * 1024 * 1024) which is be the default size for the virtual Windows XP machine I created.

    Execution of the order, even against a SCSI drive works fine.

    I'm initially create virtual machines with a disk of 1 MB and resizing in order to reduce the time of provisioning. Someone has seen this before or know a work around? We currently lack of vSphere 4.0.

    Thanks in advance

    Not sure if this is a bug or by design, it appears however that you cannot resize an IDE drive. (Interesting that you mentioned that it works up to 8GB).

    One solution is to convert the drive.

    There is a post on this topic at Yellow brick resize your virtual IDE hard drive

    André

  • Query related to the installation of hard drives

    Original title: hard drives
    I have two hard drives and I want to set up as
     
    1. a stand-alone hard disk that holds the operating system
    2. the second hard drive to keep the files like doc, files, photos, video, and downloads.
    How can I do this?
    Thanks in advance.

    It's just a matter of creating a partition on the 2nd HARD drive. Then you can use it for whatever you like.
    You can install programs, or just use it to store data.
    HARD drive with a speed lower than 7200 RPM are generally best left to the storage (Western Digital Black are
    7200 RPM. Their VelociRaptor is the record of 10 000 rpm).
    Software load a little slower and may run more slowly on the 5200 RPM HARD drive. Are the 'Greens' HDD
    usually about 5200 RPM.

    -If you run short on the HARD the OS disk space is a way to create more space
    move your music, photos and video to the other HARD disk records.

    A method to move the folders in your main user folder is to R / click the respective folder
    and go to Properties.
    Click the location , and then select the partition or folder on your HARD drive that you want to move
    This folder is a subfolder of.
    After data is transferred, it will be a new shortcut to this new location in libraries.

    -If you do not use the libraries you can simply move the data to a new folder on the other HARD drive
    (without using the 'rent' option) and pin a shortcut from the new folder to the
    Icon from the Windows Explorer in the taskbar.

    [If you also need information on how to set up partitions and otherwise manage the HDD-]
    The two HARD drives should show up in disk management. This is where you create or delete partitions on your
    HARD drives
    Go to control panel (or start menu) > administrative tools > computer management.
    Then click on disk management.
    -The HARD drive with the operating system will say - ( system, start...) Main partition). It could be either disk 0 or 1 depending on the port on which the HARD drive is connected to the motherboard.
    The other disk HARD would have "unallocated space" If no partition was made.
    If the disc already has data, then it must also propose in the Start Menu > computer and data
    should be accessible and ready for to add you more data.
    If the 2nd HARD drive has no data that you have just made a new Partition. With a drive of 80 GB HARD is a single partition
    generally the best option for the management of space.

    You can get more details on how to use the disk by typing disk management management in the
    Search box Start > Help and Support.

    .

  • Satellite L70-A-139 - guaranteed zero when removing the cover for the RAM and HARD drive

    Hi all

    I have a Satellite L70-A-139 youcef.
    And at the back of the laptop, there is a cover that is fixed with a screw.

    Wil I void the warranty when I unscrew and take a look?
    I want to upgrade my HDD to SSD.
    The motherboard supports Sata III: D.

    Thank you!

    No, the mandate must still be valid.
    There is a removable cover at the bottom of the unit as shown here:
    [Toshiba Satellite C70 / C75 / C70D / C75D / L70 / L70t / S70 / HARD S70t drive replacement procedure | http://aps2.toshiba-tro.de/kb0/CRU3703HG0000R01.htm]

    Then you should be able to upgrade the RAM and HARD drive.
    I think this info should be mentioned in the user manual too.

  • Satellite P100-354: how many rpm has the 160 GB hard drive

    How many rpm has the 160 GB hard drive?
    And. It is a SATA?

    Hello

    to answer your questions:

    The disc has a speed of 4200 RPM and YES it s a SATA drive.

    Hope I could clear your mind. :)

    See you soon

  • Satellite M40X-112: can I use the 160 GB HARD drive

    I have a Satellite M40X-112 lapptop and I want to upgrade my 80 GB to 160 GB internal drive.
    How is know possible? (Toshiba hotline cannot give me an answer only that a 80 GB drive has been tried with these lapptop!). Anyone have experience with that?

    I read several statements here in the forum about HDD upgrade on the M40X and it seems that there is a limitation in the BIOS.
    The BISO will not recognize the 160 GB HARD drive and that is why you will be not possible to install an OS or you will not be able to boot from this device.

    Please use the "advanced search" from this forum to find discussions on upgrading the HARD drive.

  • Satellite C650D-112 - reinstall Win 7 after the failure of HARD drive

    The 320 HDD on my C650D-112 18 months, failed last week.
    I replaced it with a 128 GB SSD and it now boots into Windows 8 preview in about 10 seconds!

    I have a copy of the disk HARD original including the recovery of HARD drive Partition, but no recovery disk.
    I can't reinstall drive would work I had been a responsible adult and created the disk when the laptop is new because the disk is smaller.

    Is it possible to reinstall the original Windows 7 Home Premium operating system of the copy of the HARD drive recovery Partition?

    > Is it possible to reinstall the original Windows 7 Home Premium operating system of the copy of the HARD drive recovery Partition?

    No, to my knowledge, this is not possible, even if you copy the contents of the recovery of HARD drive on the new partition on the new HARD drive, HARD drive recovery option does not appear in the advanced boot menu.
    So, it seems you need to order a new drive to get here:
    http://backupmedia.Toshiba.EU/landing.aspx

  • Available to add the second internal hard drive to 17-e117dx

    Hello

    Can you let me know, if there is provision to add the second internal hard drive for HP Pavilion e117dx 17.

    If so, one) is there requirments or the specifications of the hard disk (any make or model); (b) what equipment will be needed and where I can get to and c) Finally will be doing so make sure the warranty of my laptop HP Sub

    HP Pavilion

    Product: F9J38UA #ABA

    Model: 17-e117dx

    Thank you

    Not in the way you probably do. Here is the Service Manual:

    Manual

    See Page 50. Unlike the Envy 17 and Pavilion dv7, Pavilion 17 has that a single hard drive Bay. The only way to add a second hard drive is to remove the DVD (optical drive) and insert a DVD to the hard drive bay adapter. The manual shows how to remove the DVD player and you can buy the adapter at amazon.com or jacobsparts.com. Note that this is a 9.5 mm thick disc, not a 12.7 mm. Both types are available. I do not recommend the adapter DVD player solution because you lose the use of the optical drive, and also because the interface of optical drive is usually not as fast as the main hard drive interface. Always fast enough for simple storage and you can run a video of her, but you do not want to edit the video of this disc, for example.

    https://www.jacobsparts.com/items/HDDBAY-02/

    If you decide to go the route of adapter DVD I would buy a large capacity 5400 RPM SATA 2.5 inches wide and drive hard thickness 9.5 mm. No sense in buying a reader more expensive high-performance.

    http://www.Newegg.com/product/product.aspx?item=N82E16822178006

    If it's 'the Answer' please click on 'Accept as Solution' to help others find it.

  • Qosmio F10 - cannot change the type of HARD drive in the BIOS

    I want to change my hard drive, but the category in the BIOS is not editable.

    I can not change the type of hard drive in the BIOS on my desktop PC.

    Hello

    And you want to change in the BIOS now?
    I put t know which option you mean exactly

    The drive in the BIOS, you can change t. That's why you should buy a new

  • Low beginning on Satellite M40-145 after changing the 160 GB HARD drive

    Hello

    I own a Satellite M40-145 since 2005. After more than two years without any problem, two weeks ago the 80 GB hard drive to the original address has been damaged. So I had to replace it with a new, 160 GB (this replacement was made in a store because it's out of warranty).

    I used successfully on the new HARD drive recovery CD to install Windows XP and all the drivers (just as when it was new).
    I used Partition Magic to create a partition of D for data. Also, I installed Office 2003, Norton 360 and connected to the Internet.
    It worked quickly with only small problems than perhaps with little patience I could fix: as this Bluetooth hardware is not detected and the wireless switch began with the lights off even being in the position we (it worked with new just switching out-lit again). But suddenly, after only one day of use, Windows starts became very slow. It takes about 4-5 minutes until it is possible to use the laptop.

    Now, I tried many possibilities to solve the problem, but always ending on the same problem: I used the recovery CD again and try to use the computer with or without updates (I thought that maybe the problem was due to a bad update), with and without Internet access, etc.
    I also tried in vain the program Microsoft Bootvis to try to speed up the startup, etc.

    I even created an image with Acronis to only with XP and Office running fast, so that I could install it again and try new things.
    I also tried to clean the registry with various programs like CCleaner, TuneUp 2008
    Also the defrag JKDefrag and PageDefrag. But always returning to the same problem after a few days of good conduct.

    I don't know what else I could do. I wonder if maybe the new HD is damaged (although I test and no error or no damage was detected) or if the update BIOS might resolve this problem (I'm not and that's a big risk).

    Please, could someone help me?
    Thank you very much for your attention.
    Pablo

    In my view, that there is nothing wrong with the software or all drivers on you laptop.
    I think the key is the enormous size of the HARD drive.

    The difference between 80 and 160 GB is huge.

    To my knowledge, the BIOS supports a limit on the size of HARD drive and I really wonder why the 160 GB HARD drive has been recognized by the BIOS.

    However, I think you should test a 100 GB, 120 GB HDD if the same question perhaps if poster using a HDD a size smaller.

    Best regards

  • M60: Question about the speed of HARD drive

    Hello

    does anyone know what RPM disk hard m60 turns to?

    That means Smart in the specification of HARD drive?

    Thank you very much
    Panos

    Panos Hi,

    In my view, that the hard drive in the M60 turn 4 200 RPM.

    S.M.A.R.T. means Self -Monitoring hasnalysis and Rinputs of technology. A system in which the hard drive can monitor his own health and report on potential failures before they occur.

    Kind regards

  • laptop Compaq CQ58: id of failure to the dst short hard drive RGF0R0

    my notebook Compaq CQ58 3 year, husbands, froze and wouldn't respond, after a few hours I force it down by pressing the power button, when I tried to start it up again once he went int automaticic repair, it took more than 24 hours.

    but the computer continues to freeze and go into the auto repair each time and was unusable.

    I don't have a recovery disk, none came with the computer and stupidley has not created a when the computer was new. being the only other computer that I have a windows vista I could not create one on this machine.

    As their was anything important stored on the computer I decided to reset the computer hoping that would solve the problem.

    I followed the instructions and the computer seems to be going through the motions to reinstall when he got stuck in a loop of

    the HP points logo swirling

    a popup with the date and time and please wait

    a white screen with the top of the window cmd at the bottom left of the screen

    back to points logo and swirling HP

    a popup with the date and time and please wait

    a white screen with the top of the window cmd at the bottom left of the screen

    After 48 hours I force crashed computer

    I ran the race test that everything happened except the short DST hard drive

    Falure ID: RGF0R0 - 69781:-MFKT1F-60WU03

    This means that the hard drive needs to be replaced and if so should I also a recovery disc, the laptop is out of warranty

    Thanks in advance for any help

    Fiona-s wrote:

    I ran the race test that everything happened except the short DST hard drive

    Falure ID: RGF0R0 - 69781:-MFKT1F-60WU03

    This means that the hard drive needs to be replaced and if so should I also a recovery disc, the laptop is out of warranty

    Thanks in advance for any help

    Hello Fiona-s,

    Thanks for posting in the Forum of Support HP!

    I'm afraid that the HARD drive has failed - the question is material one and all simply restore/reinstall will not solve it. Yes, you need to replace the HARD disk new or better with the SSD. SSDS are up to 10 times faster than hard drives:

    > http://ocz.com/consumer/ssd-guide/ssd-vs-hdd

    > https://en.wikipedia.org/wiki/Solid-state_drive

    There are more than 100 manufacturers and sellers SSD, but personally, I would choose Samsung, Intel, Toshiba, or OCZ ones.

    Microsoft Windows 7, 8.1, and 10 have supported for SSDS. Vista and XP - no

    You will need a recovery media to restore the windows once you have installed the new SSD or HARD disk.

    You can get possible by contacting HP Support. Here's how:

    > http://support.hp.com/us-en/document/bph07143

    > http://www8.hp.com/us/en/contact-hp/contact.html

    > http://www8.hp.com/us/en/contact-hp/ww-phone-assist.html

    Feel free to post if you have any other questions.

Maybe you are looking for

  • after update to v10.11.6 my hotmail login is not recognized

    After the last Maverick v10.11.6 update my hotmail login is not recognized.

  • Do I need Internet Explorer security updates if I use Firefox?

    Hello! I can't find an answer to this question via a Google search, so I ask you here please. I use Windows 7 and see a lot of regular updates to Internet Explorer during installation. But I never use Internet Explorer, I only use Firefox. So I wante

  • 18.0.1 version won't save tabs on exit.

    My FF was just updated today to 18.0.1 self and now when I close FF it does not save my tabs. I've always had "When FF starts" the value "show my windows and tabs from last time. I saw a 14.0.1 earlier problem that said delete sessionstore.js but whe

  • Satellite P850 - need WLAN Driver for Windows 8.1 64bits

    I have Satellite P850: I renewed my Kaspersky Internet Security and Windows update to 8.1 made 64 bit. Now, I have no wireless LAN driver. I can only connect to the internet through an ethernet cable. I searched high and low for 2 days looking for a

  • Skype disappears after the computer restarts

    Hi all Since 3 days ago Skype disappears from my computer when I turned off my computer or when I turn it back on again. In any case, after every reboot I reinstall Skype, which works as normal until I shut the computer off again. I use Windows 8. I'