Citrix Virtual Apps and Desktops 2411 SDK

Get-ProvResource

Introduced in: Citrix Virtual Apps and Desktop 7 2206

Gets the list of resources created for provisioning schemes, image versions, and virtual machines.

Syntax

Get-ProvResource
   -ProvisioningSchemeName <String>
   [<CitrixCommonParameters>]
   [<CommonParameters>]
<!--NeedCopy-->
Get-ProvResource
   -ProvisioningSchemeUid <Guid>
   [<CitrixCommonParameters>]
   [<CommonParameters>]
<!--NeedCopy-->

Description

Let you retrieve the list of provisioning resources, such as disks created for a provisioning scheme, image versions, and virtual machines.

Examples

EXAMPLE 1

Returns the ProvisionedScheme object, ProvisionedImageVersion object, and ProvisionedVirtualMachine object for the provisioning scheme ID “e9aa1cf8-b2a8-4c3c-a309-1d53f7882e92.”

$result = Get-ProvResource -ProvisioningSchemeUid 'e9aa1cf8-b2a8-4c3c-a309-1d53f7882e92'
$result

ProvisionedScheme                                    ProvisionedImageVersion
-----------------                                    -----------------------
Citrix.MachineCreation.Sdk.ProvisionedSchemeResource {/example.vm/example.snapshot, /example...
<!--NeedCopy-->

EXAMPLE 2

Returns the Id, Name, and Resource of the ProvisionedScheme object for the provisioning scheme ID “e9aa1cf8-b2a8-4c3c-a309-1d53f7882e92.”

$result = Get-ProvResource -ProvisioningSchemeUid 'e9aa1cf8-b2a8-4c3c-a309-1d53f7882e92'
$result.ProvisionedScheme

Id                                   Name                    Resource
--                                   ----                    --------
e9aa1cf8-b2a8-4c3c-a309-1d53f7882e92 Example_Catalog
<!--NeedCopy-->

EXAMPLE 3

Returns ImageStatus, ID, and Name of the ProvisionedImageVersion sub-object for the provisioning scheme ID “e9aa1cf8-b2a8-4c3c-a309-1d53f7882e92.”

$result = Get-ProvResource -ProvisioningSchemeUid 'e9aa1cf8-b2a8-4c3c-a309-1d53f7882e92'
$result.ProvisionedImageVersion

ImageStatus Id                                   Name
----------- --                                   ----
Deleted     92bd1cb2-4d16-43ad-8672-04b28889f072 /example.vm/example.snapshot
Current     def7badc-4769-4c5d-93e1-2c20018dca26 /example.vm/example.snapshot
Deleted     9dca4d28-acc6-49c8-bdc4-94cc12b958ea /example.vm/example.snapshot
<!--NeedCopy-->

EXAMPLE 4

Returns the Resource (Id, ResourceType, and Metadata) of the ProvisionedImageVersion object for the provisioning scheme ID “e9aa1cf8-b2a8-4c3c-a309-1d53f7882e92.”

$result = Get-ProvResource -ProvisioningSchemeUid 'e9aa1cf8-b2a8-4c3c-a309-1d53f7882e92'
$result.ProvisionedImageVersion[1].Resource

Id                                   ResourceType Metadata
--                                   ------------ --------
0005f0fa-2f3f-4361-9103-5d9e6b9c656c Disk         {Role, StorageId}
<!--NeedCopy-->

EXAMPLE 5

Returns the Metadata (Role and StorageId) of the resource of the ProvisionedImageVersion sub-object for the provisioning scheme ID “e9aa1cf8-b2a8-4c3c-a309-1d53f7882e92.”

$result = Get-ProvResource -ProvisioningSchemeUid 'e9aa1cf8-b2a8-4c3c-a309-1d53f7882e92'
$result.ProvisionedImageVersion[1].Resource[0].Metadata

Key       Value
---       -----
Role      Base Disk
StorageId 1a033f55-d552-5ba9-e364-2af7b859303e
<!--NeedCopy-->

EXAMPLE 6

Returns ID, Name, and Resource of the provisioned virtual machines for the provisioning scheme ID “e9aa1cf8-b2a8-4c3c-a309-1d53f7882e92.”

$result = Get-ProvResource -ProvisioningSchemeUid 'e9aa1cf8-b2a8-4c3c-a309-1d53f7882e92'
$result.ProvisionedVirtualMachine

Id                                   Name        Resource
--                                   ----        --------
7141f207-844f-f271-a076-10258186bb52 ExampleVM01 {00000000-0000-0000-0000-000000000000, 539e7ebb-296f-4021-9faa-8614ff159e77, 00000000-000...
1f8cceed-1c6b-efb3-079e-486477e2b2c2 ExampleVM02 {00000000-0000-0000-0000-000000000000, 2574798c-014c-4457-9040-d040246c2dc8, 00000000-000...
<!--NeedCopy-->

EXAMPLE 7

Returns the Resource (Id, ResourceType, and Metadata) of the ProvisionedVirtualMachine object for the provisioning scheme ID “e9aa1cf8-b2a8-4c3c-a309-1d53f7882e92.”

$result = Get-ProvResource -ProvisioningSchemeUid 'e9aa1cf8-b2a8-4c3c-a309-1d53f7882e92'
$result.ProvisionedVirtualMachine[0].Resource

Id                                   ResourceType Metadata
--                                   ------------ --------
00000000-0000-0000-0000-000000000000 Disk         {Role, ParentDiskId, StorageId}
539e7ebb-296f-4021-9faa-8614ff159e77 Disk         {Role, StorageId}
00000000-0000-0000-0000-000000000000 Disk         {Role, StorageId}
<!--NeedCopy-->

EXAMPLE 8

Returns the Metadata (Role, ParentDiskID, and StorageId for OS Delta Disk) of the Resource of the ProvisionedVirtualMachine object for the provisioning scheme ID “e9aa1cf8-b2a8-4c3c-a309-1d53f7882e92.”

$result = Get-ProvResource -ProvisioningSchemeUid 'e9aa1cf8-b2a8-4c3c-a309-1d53f7882e92'
$result.ProvisionedVirtualMachine[0].Resource[0].Metadata

Key          Value
---          -----
Role         OS Delta Disk
ParentDiskId 5eef2ad5-2b05-442c-a5b5-1a7e9ecaf36d
StorageId    1a033f55-d552-5ba9-e364-2af7b859303e
<!--NeedCopy-->

EXAMPLE 9

Returns the Metadata (Role and StorageId for Identity Disk) of the Resource of the ProvisionedVirtualMachine object for the provisioning scheme ID “e9aa1cf8-b2a8-4c3c-a309-1d53f7882e92.”

$result = Get-ProvResource -ProvisioningSchemeUid 'e9aa1cf8-b2a8-4c3c-a309-1d53f7882e92'
$result.ProvisionedVirtualMachine[0].Resource[1].Metadata

Key       Value
---       -----
Role      Identity Disk
StorageId 1a033f55-d552-5ba9-e364-2af7b859303e
<!--NeedCopy-->

EXAMPLE 10

Returns the Metadata (Role and StorageId for Personal Virtual Disk) of the Resource of the ProvisionedVirtualMachine object for the provisioning scheme ID “e9aa1cf8-b2a8-4c3c-a309-1d53f7882e92.”

$result = Get-ProvResource -ProvisioningSchemeUid 'e9aa1cf8-b2a8-4c3c-a309-1d53f7882e92'
$result.ProvisionedVirtualMachine[0].Resource[2].Metadata

Key       Value
---       -----
Role      PersonalVDisk
StorageId
<!--NeedCopy-->

Parameters

-ProvisioningSchemeName

The name of the provisioning scheme.

Type: String
Position: Named
Default value: None
Required: True
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: True

-ProvisioningSchemeUid

The unique identifier of the provisioning scheme.

Type: Guid
Position: Named
Default value: None
Required: True
Accept pipeline input: False
Accept wildcard characters: True

CitrixCommonParameters

This cmdlet supports the common Citrix parameters: -AdminAddress, -AdminClientIP, -BearerToken, -TraceParent, -TraceState and -VirtualSiteId. For more information, see about_CitrixCommonParameters.

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Inputs

Citrix.MachineCreation.Sdk.ProvisioningScheme

You can pipe an object containing a parameter called ‘ProvisioningSchemeName’ to Get-ProvResource.

Outputs

Citrix.MachineCreation.Sdk.ProvisionedResource

This object provides details of the provisioning scheme and contains the following information:

ProvisionedScheme <Citrix.MachineCreation.Sdk.ProvisionedSchemeResource>

An object containing provisioning scheme id, name, and resources attached to the provisioning scheme.

ProvisionedImageVersion <Citrix.MachineCreation.Sdk.ProvisionedImageVersionResource[] >

A list of objects containing provisioning scheme id, name, and resources attached to the provisioning image versions.

ProvisionedVirtualMachine <Citrix.MachineCreation.Sdk.ProvisionedVirtualMachineResource[] >

A list of objects containing provisioning scheme id, name, and resources attached to the provisioned virtual machines.

Notes

The Get-ProvResource cmdlet returns an object containing three sub-objects:

  • The provisioned scheme
  • Array of provisioned image versions
  • Array of provisioned virtual machines

In the case of failure, the following errors can result.

Error Codes


ProvisioningSchemeNotFound

The specified provisioning scheme could not be located.

ProvisioningSchemeNotReady

The specified provisioning scheme is not in Ready state.

Get-ProvResource