I ran thw Search-Cloud command for the first time and got error stating it didn't know what "Type" was. So I ran the help and checked the online version of help too and example 2 has the following:
-------------- Example 2 --------------
Search-Cloud -Type vAppTemplate
Searches the cloud server for virtual appliance templates. The user is connected as a cloud user.
If I ran that exact command as is and I get the following error:
PS C:\> Search-Cloud -Type vAppTemplate
Search-Cloud : A parameter cannot be found that matches parameter name 'Type'.
At line:1 char:19
+ Search-Cloud -Type <<<< vAppTemplate
+ CategoryInfo : InvalidArgument: (:) [Search-Cloud], ParameterBindingException
+ FullyQualifiedErrorId : NamedParameterNotFound,VMware.VimAutomation.Cloud.Commands.Cmdlets.SearchCloud
Yet if I leave out "Type" I get the expected results...
PS C:\> Search-Cloud vAppTemplate
OwnerName : system
CatalogName : Build 60.00 (LC1)
IsPublished : True
Name : Workspace 60.00
Vdc : urn:vcloud:vdc:fe195c89-b533-4e06-8aa8-1a7b37161802
VdcName : My_vDC
Org : urn:vcloud:org:900c1326-586a-4a9b-ba00-b64dcca88fc0
CreationDate : 3/22/2012 4:30:11 PM
IsBusy : False
IsGoldMaster : False
IsEnabled : True
Status : RESOLVED
IsDeployed : False
Href :
Id : urn:vcloud:vapptemplate:1be79364-793a-41f8-bf85-b8c1e2296863
Type :
AnyAttr : {cpuAllocationMhz, isInCatalog, task, numberOfShadowVMs...}
Link :
This is not a major issue, but it's not the only issue I've picked up with Search-Cloud, If I try filter by CatalogName I get and error too...
PS C:\> Search-Cloud VAppTemplate -filter 'CatalogName==Build 60.00 (LC4)'
Search-Cloud : 3/25/2012 4:18:59 PM Search-Cloud The specified Href 'https://10.1.101.181/api/query?type=vAppTemplate&format=idrecords
&filter=catalogName==Build 60.00 (LC4)&pageSize=128' is not valid.
At line:1 char:13
+ Search-Cloud <<<< VAppTemplate -filter 'CatalogName==Build 60.00 (LC4)'
+ CategoryInfo : NotSpecified: (:) [Search-Cloud], VimException
+ FullyQualifiedErrorId : Core_BaseCmdlet_UnknownError,VMware.VimAutomation.Cloud.Commands.Cmdlets.SearchCloud
Here are my versions:
PS C:\> Get-PowerCLIVersion
PowerCLI Version
----------------
VMware vSphere PowerCLI 5.0.1 build 581491
---------------
Snapin Versions
---------------
VMware AutoDeploy PowerCLI Component 5.0 build 544967
VMware ImageBuilder PowerCLI Component 5.0 build 544967
VMware vCloud Director PowerCLI Component 1.5 build 581492
VMware License PowerCLI Component 5.0 build 544881
VMware vSphere PowerCLI Component 5.0 build 581435
Anyone get the same error?
Firstly, thanks, the EXAMPLE 1 is wrong, i will get this fixed in the next version, it should be -QuerType not -Type
On your filter search it looks like you have spaces in the name, try putting quotes around it to see if that helps.
Alan
Thanks Alan, thought I was going mad :smileygrin: But I think you made a typo in your response, I assume you meant -QueryType NOT -QuerType
With regards to double quotes...I tried earlier today with double and and single quotes but it didn't help:
PS C:\> Search-Cloud -QueryType VAppTemplate -filter 'CatalogName=="Build 60.00 (LC4)"'
Search-Cloud : 3/25/2012 7:59:00 PM Search-Cloud The specified Href 'https://10.1.101.181/api/query?type=vAppTemplate&format=idrecords
&filter=CatalogName=="Build 60.00 (LC4)"&pageSize=128' is not valid.
At line:1 char:13
+ Search-Cloud <<<< -QueryType VAppTemplate -filter 'CatalogName=="Build 60.00 (LC4)"'
+ CategoryInfo : NotSpecified: (:) [Search-Cloud], VimException
+ FullyQualifiedErrorId : Core_BaseCmdlet_UnknownError,VMware.VimAutomation.Cloud.Commands.Cmdlets.SearchCloud
PS C:\> Search-Cloud -QueryType VAppTemplate -filter 'CatalogName=='Build 60.00 (LC4)''
The term 'LC4' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a pa
th was included, verify that the path is correct and try again.
At line:1 char:77
+ Search-Cloud -QueryType VAppTemplate -filter 'CatalogName=='Build 60.00 (LC4 <<<< )''
+ CategoryInfo : ObjectNotFound: (LC4:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
Strangely replacing spaces with underscores gets me closer and actually works:
PS C:\> Search-Cloud -QueryType VAppTemplate -filter 'CatalogName==Build_60.00_(LC4)*'
OwnerName : system
CatalogName : Build 60.00 (LC4)
IsPublished : True
Name : Workspace 60.00
Vdc : urn:vcloud:vdc:fe195c89-b533-4e06-8aa8-1a7b37161802
VdcName : Org_vDC
Org : urn:vcloud:org:900c1326-586a-4a9b-ba00-b64dcca88fc0
CreationDate : 3/22/2012 4:31:52 PM
IsBusy : False
IsGoldMaster : False
IsEnabled : True
Status : RESOLVED
IsDeployed : False
Href :
Id : urn:vcloud:vapptemplate:f5872a16-43f9-48e4-a365-8df23440eed6
Type :
AnyAttr : {cpuAllocationMhz, isInCatalog, task, numberOfShadowVMs...}
Link :
Yet removing the star * from the end of the command above with the underscores produces not results but no errors.
Wrapping the above line, with the underscores in it, in double quotes with and without the star * on the end, errors as well.
Long story short: Replacing spaces with underscores and putting a * on the end is a temporary fix.
Thanks!
Yeah sorry, that was -QueryType !
I will put a space in one of my names tomorrow and test this out.
Thanks
Looks to me like the same urlencoding bug as here:
http://communities.vmware.com/message/1897735#1897735
basically spaces aren't being converted to "%20"