Quantcast
Channel: VMware Communities: Message List
Viewing all articles
Browse latest Browse all 189307

Deleting OrgVDC Network on VCD via PowerCLI

$
0
0

Hi Folks,

I'm having some issues when executing some script in PowerCLI hitting Vcloud Director.

 

The overall script, pretty much "strikes out" an organization (including vCenter DPG's), but I'm getting stuck on an error it throws when collecting OrgNetworks data for removal.


The Specific Line is:

Get-OrgNetwork -Org $ORG | Remove-OrgNetwork

 

I have also tried:

Get-OrgNetwork -Org $ORG | foreach-object {Remove-OrgNetwork $_}


but no success...

the error I detect here is a variable casting error... perhaps it is a PowerCLI bug?

Remove-OrgNetwork : 7/10/2013 5:25:11 PMRemove-OrgNetwork    Unable to cast object of type 'VMware.VimAutomation.Cloud.Views.

OrgVdcNetwork' to type 'VMware.VimAutomation.Cloud.Views.OrgNetwork'.   

At line:36 char:45

+ Get-OrgNetwork -Org $ORG | Remove-OrgNetwork <<<< 

+ CategoryInfo      : NotSpecified: (:) [Remove-OrgNetwork], CIException
+ FullyQualifiedErrorId : CloudImpl_OrganizationNetworkServiceImpl_DeleteOrgNetwork_CIError,VMware.VimAutomation.Cloud.Commands.

   Cmdlets.RemoveOrgNetwork

 

 

 

As you may see it is expecting a certain type of object but receives another one. However the CmdLet is of the same kind and even from the same collection. (Vmware.Vimautomation.Cloud)

 

Any thoughts?

Many thanks,

 

Alejandro.


Viewing all articles
Browse latest Browse all 189307

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>