Citrix Virtual Apps and Desktops SDK


Gets the resource items and child items from specified inventory locations using the resource type and a set of filtering and pagination parameters.


Get-HypInventoryItem [-LiteralPath] <String> -ResourceType <String> [-ContinuationToken <String>] [-MaxRecords <Int32>] [-Skip <Int32>] [-ContainsName <String>] [-ForwardDirection <Boolean>] [-Tags <String>] [-Id <String>] [-AdditionalDataFilter <String>] [-Template <String>] [-Warn <Boolean>] [-Force <Boolean>] [-BearerToken <String>] [-TraceParent <String>] [-TraceState <String>] [-VirtualSiteId <String>] [-AdminAddress <String>] [<CommonParameters>]


Detailed Description

The `Get-HypInventoryItem` cmdlet gets the resource items and child items from specified inventory locations using the resource type and a set of filtering and pagination parameters.

`Get-HypInventoryItem` requires a Hosting Unit path and the ResourceType parameter. The ResourceType specifies the resource extension, such as `template` or `vm`.

Optional parameters control how many items to return, where to start the list of items and how to filter items so that only a subset are returned.


Name Description Required? Pipeline Input Default Value
LiteralPath This specifies the XDHyp:\ path to the Hosting Unit for the inventory to use. This parameter is required. true true (ByValue)  
ResourceType This parameter specifies the type of the resources to return. This is a required parameter and corresponds to the resource Name extension, such as `template` or `vm`. true true (ByValue)  
ContinuationToken This parameter controls where to start including items from the inventory. This is usually the `Id` of an item and the included items begin after the given item is found. false true (ByValue)  
MaxRecords The maximum number of items to return for the given call of the cmdlet. The default is to return one item. false true (ByValue) 1
Skip Skips the specified number of records before returning results. Also reduces the count returned by -ReturnTotalRecordCount. false true (ByValue) 0
ContainsName This parameter filters items so that only the ones containing the given string in the `Name` are included. false true (ByValue)  
ForwardDirection Specifies whether the items are returned in forward page order (the default) or reverse. false true (ByValue) True
Tags This parameter specifies a JSON dictionary where the keys are the tag names and the values are the tag values. The parameter is used to filter items which have the given tags. An item must have all the given tags to match. Special values of `Not tagged` and `All values` are supported. false true (ByValue)  
Id This parameter returns a single item with the given Identifier. false true (ByValue)  
AdditionalDataFilter This specifies a JSON dictionary of parameters to use in filtering resources using the AdditionalData properties. All values given must match for an item to be included. false true (ByValue)  
Template This parameter is used for the Machine Profile ResourceTypes only. It specifies a Template identifier or name to use in validation of the Machine Profile with the given Template. The validation will pass if the given Machine Profile resource is compatible with the given Template. Only Machine Profiles which pass this validation are included. false true (ByValue)  
Warn This parameter is used for along with any validation filtering parameter (such as TemplateId). It specifies that rather than excluding the items which failed validation, the item is included but with a Warning property added to the AdditionalData. This property carries a string which describes the reason for validation failure. false true (ByValue) False
Force Specifies whether to return the full list of items or whether to exclude the items created as part of Machine Creation Services. The default behavior is to exclude the MCS created items. false true (ByValue) False
BearerToken Specifies the bearer token assigned to the calling user false false  
TraceParent Specifies the trace parent assigned for internal diagnostic tracing use false false  
TraceState Specifies the trace state assigned for internal diagnostic tracing use false false  
VirtualSiteId Specifies the virtual site the PowerShell snap-in will connect to. false false  
AdminAddress Specifies the address of a XenDesktop controller the PowerShell snap-in will connect to. You can provide this as a host name or an IP address. false false Localhost. Once a value is provided by any cmdlet, this value becomes the default.

Input Type

Return Values


A list of inventory items which are found in the given Hosting Unit inventory of the given ResourceType and matching any optional filtering parameters. As a convenience the first item of the list contains AdditionalData fields for `TotalItemsCount`, `TotalFilteredItemsCount` and `Tags`. These fields provide the counts of all the items of the ResourceType in the inventory, the set of items which would match the filters and a set of tags which may be used to filter the items, respectively.




Example 1

Get-HypInventoryItem -LiteralPath 'XDHyp:\HostingUnits\ctx-apollo' -ResourceType template

PSPath                  : Citrix.Host.Admin.V2\Citrix.Hypervisor::XDHyp:\HostingUnits\ctx-apollo\21a18e41-8cc1-4aeb-b43

                          e-06f2678fe386.d83d0782-cb94-46d7-8993-f4ce15d1a484.DC0001 (ami-0d3989f916a1ddecd).template

PSParentPath            : Citrix.Host.Admin.V2\Citrix.Hypervisor::XDHyp:\HostingUnits\ctx-apollo

PSChildName             : 21a18e41-8cc1-4aeb-b43e-06f2678fe386.d83d0782-cb94-46d7-8993-f4ce15d1a484.DC0001


PSDrive                 : XDHyp

PSProvider              : Citrix.Host.Admin.V2\Citrix.Hypervisor

PSIsContainer           : False

Description             : Canonical, Ubuntu, 16.04 LTS, amd64 xenial image build on 2020-09-22

HasPersistentRootVolume : True

IsWindowsTemplate       : True

Owner                   : 679593333241

AdditionalData          : {[TotalItemsCount, 56], [TotalFilteredItemsCount, 56]}

FullName                : 21a18e41-8cc1-4aeb-b43e-06f2678fe386.d83d0782-cb94-46d7-8993-f4ce15d1a484.DC0001


FullPath                : XDHyp:\HostingUnits\ctx-apollo\21a18e41-8cc1-4aeb-b43e-06f2678fe386.d83d0782-cb94-46d7-8993-f

                          4ce15d1a484.DC0001 (ami-0d3989f916a1ddecd).template

Id                      : ami-0d3989f916a1ddecd

IsContainer             : False

IsMachine               : False

IsSnapshotable          : False

IsSymLink               : False

Name                    : 21a18e41-8cc1-4aeb-b43e-06f2678fe386.d83d0782-cb94-46d7-8993-f4ce15d1a484.DC0001


ObjectPath              : /21a18e41-8cc1-4aeb-b43e-06f2678fe386.d83d0782-cb94-46d7-8993-f4ce15d1a484.DC0001


ObjectType              : Template

ObjectTypeName          : template



Gets the first template resource from the ctx-apollo Hosting Unit