Reply to Message

View discussion in a popup

Replying to:
LucD
Leadership
Leadership

There is something wrong with the passing of the CapacityGB property over the pipeline.

Try this variation.

Import-Csv -Path 'C:\temp\testvms.csv' | %{

   Get-VM -Name  $_.Name |

   Get-HardDisk -Name 'Hard disk 1' | %{

       Set-HardDisk -HardDisk $_ -CapacityGB ($_.CapacityGB + 20) -Confirm:$false

    }

}


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

View solution in original post

Reply
0 Kudos