<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Script to add new hard disk to multiple VM's in VMware PowerCLI Discussions</title>
    <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Script-to-add-new-hard-disk-to-multiple-VM-s/m-p/2915560#M107147</link>
    <description>&lt;P&gt;Hello Maya,&lt;/P&gt;&lt;P&gt;Getting error can help me out..Please&lt;/P&gt;&lt;P&gt;New-HardDisk : 23/06/2022 10:30:12 New-HardDisk Strings as pipeline input are not supported.&lt;BR /&gt;At C:\temp\win.ps1:6 char:9&lt;BR /&gt;+ $vm | New-HardDisk -CapacityGB 10 -DiskType PMem&lt;BR /&gt;+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~&lt;BR /&gt;+ CategoryInfo : InvalidArgument: (:) [New-HardDisk], VimException&lt;BR /&gt;+ FullyQualifiedErrorId : Core_ObnArgumentTransformationAttribute_Transform_InvalidPipelineArgument,VMware.VimAutomation.ViCore.Cmdlets.Commands.VirtualDevice.NewHardDisk&lt;/P&gt;&lt;P&gt;New-HardDisk : 23/06/2022 10:30:12 New-HardDisk Strings as pipeline input are not supported.&lt;BR /&gt;At C:\temp\win.ps1:6 char:9&lt;BR /&gt;+ $vm | New-HardDisk -CapacityGB 10 -DiskType PMem&lt;BR /&gt;+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~&lt;BR /&gt;+ CategoryInfo : InvalidArgument: (:) [New-HardDisk], VimException&lt;BR /&gt;+ FullyQualifiedErrorId : Core_ObnArgumentTransformationAttribute_Transform_InvalidPipelineArgument,VMware.VimAutomation.ViCore.Cmdlets.Commands.VirtualDevice.NewHardDisk&lt;/P&gt;</description>
    <pubDate>Thu, 23 Jun 2022 09:31:54 GMT</pubDate>
    <dc:creator>prasanna22kumar</dc:creator>
    <dc:date>2022-06-23T09:31:54Z</dc:date>
    <item>
      <title>Script to add new hard disk to multiple VM's</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Script-to-add-new-hard-disk-to-multiple-VM-s/m-p/2915322#M107123</link>
      <description>&lt;P&gt;Hi All/Lucd,&lt;/P&gt;&lt;P&gt;Kindly help me in powershell Script to add new hard disk (10 GB) to multiple VM's.&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Kumar&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jun 2022 05:21:37 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Script-to-add-new-hard-disk-to-multiple-VM-s/m-p/2915322#M107123</guid>
      <dc:creator>prasanna22kumar</dc:creator>
      <dc:date>2022-06-22T05:21:37Z</dc:date>
    </item>
    <item>
      <title>Re: Script to add new hard disk to multiple VM's</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Script-to-add-new-hard-disk-to-multiple-VM-s/m-p/2915328#M107124</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;You need to use the New-HardDisk command. Here is its documentation link: &lt;A href="https://developer.vmware.com/docs/powercli/latest/vmware.vimautomation.core/commands/new-harddisk/#CreateNew" target="_blank" rel="noopener"&gt;https://developer.vmware.com/docs/powercli/latest/vmware.vimautomation.core/commands/new-harddisk/#CreateNew&lt;/A&gt;&lt;/P&gt;&lt;P&gt;In your case, I would do something like :&lt;/P&gt;&lt;P&gt;foreach ($vm in $vms){&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN class=""&gt;$vm&lt;/SPAN&gt; &lt;SPAN class=""&gt;|&lt;/SPAN&gt; &lt;SPAN class=""&gt;New-HardDisk&lt;/SPAN&gt; &lt;SPAN class=""&gt;-&lt;/SPAN&gt;&lt;SPAN class=""&gt;CapacityGB 10 [any_other_settings if needed to be added] | Out-Null&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Maya&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jun 2022 06:03:13 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Script-to-add-new-hard-disk-to-multiple-VM-s/m-p/2915328#M107124</guid>
      <dc:creator>mpeneva</dc:creator>
      <dc:date>2022-06-22T06:03:13Z</dc:date>
    </item>
    <item>
      <title>Re: Script to add new hard disk to multiple VM's</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Script-to-add-new-hard-disk-to-multiple-VM-s/m-p/2915359#M107132</link>
      <description>&lt;P&gt;Hi Maya,&lt;/P&gt;&lt;P&gt;Thanks for your reply..&lt;/P&gt;&lt;P&gt;If I want include 'Thin Provisioning' and create the disk on default location of the VM reside datastore.&lt;/P&gt;&lt;P&gt;Thanks in advance&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Kumar&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jun 2022 10:10:00 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Script-to-add-new-hard-disk-to-multiple-VM-s/m-p/2915359#M107132</guid>
      <dc:creator>prasanna22kumar</dc:creator>
      <dc:date>2022-06-22T10:10:00Z</dc:date>
    </item>
    <item>
      <title>Re: Script to add new hard disk to multiple VM's</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Script-to-add-new-hard-disk-to-multiple-VM-s/m-p/2915360#M107133</link>
      <description>&lt;P&gt;HI,&lt;/P&gt;&lt;P&gt;The New-HardDisk cmdlet has the needed parameters for these actions (Check the help link above).&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Maya&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jun 2022 10:22:31 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Script-to-add-new-hard-disk-to-multiple-VM-s/m-p/2915360#M107133</guid>
      <dc:creator>mpeneva</dc:creator>
      <dc:date>2022-06-22T10:22:31Z</dc:date>
    </item>
    <item>
      <title>Re: Script to add new hard disk to multiple VM's</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Script-to-add-new-hard-disk-to-multiple-VM-s/m-p/2915560#M107147</link>
      <description>&lt;P&gt;Hello Maya,&lt;/P&gt;&lt;P&gt;Getting error can help me out..Please&lt;/P&gt;&lt;P&gt;New-HardDisk : 23/06/2022 10:30:12 New-HardDisk Strings as pipeline input are not supported.&lt;BR /&gt;At C:\temp\win.ps1:6 char:9&lt;BR /&gt;+ $vm | New-HardDisk -CapacityGB 10 -DiskType PMem&lt;BR /&gt;+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~&lt;BR /&gt;+ CategoryInfo : InvalidArgument: (:) [New-HardDisk], VimException&lt;BR /&gt;+ FullyQualifiedErrorId : Core_ObnArgumentTransformationAttribute_Transform_InvalidPipelineArgument,VMware.VimAutomation.ViCore.Cmdlets.Commands.VirtualDevice.NewHardDisk&lt;/P&gt;&lt;P&gt;New-HardDisk : 23/06/2022 10:30:12 New-HardDisk Strings as pipeline input are not supported.&lt;BR /&gt;At C:\temp\win.ps1:6 char:9&lt;BR /&gt;+ $vm | New-HardDisk -CapacityGB 10 -DiskType PMem&lt;BR /&gt;+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~&lt;BR /&gt;+ CategoryInfo : InvalidArgument: (:) [New-HardDisk], VimException&lt;BR /&gt;+ FullyQualifiedErrorId : Core_ObnArgumentTransformationAttribute_Transform_InvalidPipelineArgument,VMware.VimAutomation.ViCore.Cmdlets.Commands.VirtualDevice.NewHardDisk&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jun 2022 09:31:54 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Script-to-add-new-hard-disk-to-multiple-VM-s/m-p/2915560#M107147</guid>
      <dc:creator>prasanna22kumar</dc:creator>
      <dc:date>2022-06-23T09:31:54Z</dc:date>
    </item>
    <item>
      <title>Re: Script to add new hard disk to multiple VM's</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Script-to-add-new-hard-disk-to-multiple-VM-s/m-p/2956323#M110926</link>
      <description>&lt;P&gt;this throws an error&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;At C:\temp\test.ps1:4 char:9&lt;BR /&gt;+ $vm | New-HardDisk -CapacityGB 10&lt;BR /&gt;+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~&lt;BR /&gt;+ CategoryInfo : InvalidArgument: (:) [New-HardDisk], VimException&lt;BR /&gt;+ FullyQualifiedErrorId : Core_ObnArgumentTransformationAttribute_Transform_InvalidPipelineArgument,VMware.VimAutomation.ViCore.Cmdlets.Commands.VirtualDevice.NewHardDisk&lt;/P&gt;&lt;P&gt;Below is the script i'm trying&amp;nbsp;&lt;/P&gt;&lt;P&gt;$vms=Get-Content "c:\temp\batch.txt"&lt;BR /&gt;foreach ($vm in $vms)&lt;BR /&gt;{&lt;BR /&gt;$vm|New-HardDisk -CapacityGB 10&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Feb 2023 17:03:38 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Script-to-add-new-hard-disk-to-multiple-VM-s/m-p/2956323#M110926</guid>
      <dc:creator>prasanna22kumar</dc:creator>
      <dc:date>2023-02-23T17:03:38Z</dc:date>
    </item>
    <item>
      <title>Re: Script to add new hard disk to multiple VM's</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Script-to-add-new-hard-disk-to-multiple-VM-s/m-p/2956325#M110927</link>
      <description>&lt;P&gt;What do you have in $vm?&lt;BR /&gt;A String with the name of the VM?&lt;BR /&gt;Try doing&lt;/P&gt;
&lt;LI-CODE lang="csharp"&gt;Get-VM -Name $vm | New-HardDisk -CapacityGB 10&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 23 Feb 2023 17:29:30 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Script-to-add-new-hard-disk-to-multiple-VM-s/m-p/2956325#M110927</guid>
      <dc:creator>LucD</dc:creator>
      <dc:date>2023-02-23T17:29:30Z</dc:date>
    </item>
    <item>
      <title>Re: Script to add new hard disk to multiple VM's</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Script-to-add-new-hard-disk-to-multiple-VM-s/m-p/2956327#M110928</link>
      <description>&lt;P&gt;Thanks LucD for your reply..&lt;/P&gt;&lt;P&gt;After adding the line as you mentioned getting following error.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;New-HardDisk : 23/02/2023 17:35:56 New-HardDisk The operation for the entity "xcpXXXXX" failed with the following message: "A general system error occurred: PBM error occurred&lt;BR /&gt;during PreReconfigureCallback: Fault cause: vmodl.fault.SystemError&lt;BR /&gt;;&lt;BR /&gt;"&lt;BR /&gt;At C:\temp\test.ps1:4 char:22&lt;BR /&gt;+ Get-VM -Name $vm | New-HardDisk -CapacityGB 10&lt;BR /&gt;+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~&lt;BR /&gt;+ CategoryInfo : NotSpecified: (:) [New-HardDisk], SystemError&lt;BR /&gt;+ FullyQualifiedErrorId : Client20_TaskServiceImpl_CheckServerSideTaskUpdates_OperationFailed,VMware.VimAutomation.ViCore.Cmdlets.Commands.VirtualDevice.NewHardDisk&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Kumar&lt;/P&gt;</description>
      <pubDate>Thu, 23 Feb 2023 17:38:21 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Script-to-add-new-hard-disk-to-multiple-VM-s/m-p/2956327#M110928</guid>
      <dc:creator>prasanna22kumar</dc:creator>
      <dc:date>2023-02-23T17:38:21Z</dc:date>
    </item>
    <item>
      <title>Re: Script to add new hard disk to multiple VM's</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Script-to-add-new-hard-disk-to-multiple-VM-s/m-p/2956336#M110929</link>
      <description>&lt;P&gt;See &lt;A href="https://kb.vmware.com/s/article/2118557#:~:text=This%20error%20occurs%20when%20the,Driven%20Storage%20service%20is%20running." target="_blank" rel="noopener"&gt;KB2118557&lt;/A&gt;, t&lt;SPAN&gt;his error occurs when the Profile-Driven Storage service is not running or is not accepting connections&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Feb 2023 18:46:10 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Script-to-add-new-hard-disk-to-multiple-VM-s/m-p/2956336#M110929</guid>
      <dc:creator>LucD</dc:creator>
      <dc:date>2023-02-23T18:46:10Z</dc:date>
    </item>
  </channel>
</rss>

