prasanna22kumar
Contributor
Contributor

this throws an error

 

At C:\temp\test.ps1:4 char:9
+ $vm | New-HardDisk -CapacityGB 10
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [New-HardDisk], VimException
+ FullyQualifiedErrorId : Core_ObnArgumentTransformationAttribute_Transform_InvalidPipelineArgument,VMware.VimAutomation.ViCore.Cmdlets.Commands.VirtualDevice.NewHardDisk

Below is the script i'm trying 

$vms=Get-Content "c:\temp\batch.txt"
foreach ($vm in $vms)
{
$vm|New-HardDisk -CapacityGB 10
}

 

 

Reply
0 Kudos