你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

Get-AzGallery

获取或列出库。

语法

Get-AzGallery
   [[-ResourceGroupName] <String>]
   [[-Name] <String>]
   [-Expand <String>]
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]
Get-AzGallery
   [-ResourceId] <String>
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]
Get-AzGallery
   [-GalleryUniqueName <String>]
   [-Scope <String>]
   -Location <String>
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]
Get-AzGallery
   [-GalleryPublicName <String>]
   [-Location <String>]
   [-Community]
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]

说明

获取或列出库。

示例

示例 1

Get-AzGallery -ResourceGroupName rg1 -GalleryName gallery1

ResourceGroupName : rg1
Description       : Gallery created by PowerShell.
Identifier        : 
  UniqueName      : 00000000-0000-0000-0000-000000000000-gallery1
ProvisioningState : Succeeded
Id                : /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/galleries/gallery1
Name              : gallery1
Type              : Microsoft.Compute/galleries
Location          : southcentralus
Tags              : {}

获取库“gallery1”

示例 2

Get-AzGallery -ResourceGroupName rg1

ResourceGroupName : rg1
Description       : Gallery created by PowerShell.
Identifier        : 
  UniqueName      : 00000000-0000-0000-0000-000000000000-gallery1
ProvisioningState : Succeeded
Id                : /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/galleries/gallery1
Name              : gallery1
Type              : Microsoft.Compute/galleries
Location          : southcentralus
Tags              : {}

ResourceGroupName : rg1
Description       : Gallery created by PowerShell.
Identifier        : 
  UniqueName      : 00000000-0000-0000-0000-000000000000-gallery2
ProvisioningState : Succeeded
Id                : /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/galleries/gallery2
Name              : gallery2
Type              : Microsoft.Compute/galleries
Location          : southcentralus
Tags              : {}

获取 rg1 中的所有库。

示例 3

Get-AzGallery

ResourceGroupName : rg1
Description       : Gallery created by PowerShell.
Identifier        : 
  UniqueName      : 00000000-0000-0000-0000-000000000000-gallery1
ProvisioningState : Succeeded
Id                : /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/galleries/gallery1
Name              : gallery1
Type              : Microsoft.Compute/galleries
Location          : southcentralus
Tags              : {}

ResourceGroupName : rg1
Description       : Gallery created by PowerShell.
Identifier        : 
  UniqueName      : 00000000-0000-0000-0000-000000000000-gallery2
ProvisioningState : Succeeded
Id                : /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/galleries/gallery2
Name              : gallery2
Type              : Microsoft.Compute/galleries
Location          : southcentralus
Tags              : {}

ResourceGroupName : rg2
Description       : Gallery created by PowerShell.
Identifier        : 
  UniqueName      : 00000000-0000-0000-0000-000000000000-gallery3
ProvisioningState : Succeeded
Id                : /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg2/providers/Microsoft.Compute/galleries/gallery3
Name              : gallery3
Type              : Microsoft.Compute/galleries
Location          : southcentralus
Tags              : {}

获取订阅中的所有库。

示例 4

Get-AzGallery -Name gallery*

ResourceGroupName : rg1
Description       : Gallery created by PowerShell.
Identifier        : 
  UniqueName      : 00000000-0000-0000-0000-000000000000-gallery1
ProvisioningState : Succeeded
Id                : /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/galleries/gallery1
Name              : gallery1
Type              : Microsoft.Compute/galleries
Location          : southcentralus
Tags              : {}

ResourceGroupName : rg1
Description       : Gallery created by PowerShell.
Identifier        : 
  UniqueName      : 00000000-0000-0000-0000-000000000000-gallery2
ProvisioningState : Succeeded
Id                : /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/galleries/gallery2
Name              : gallery2
Type              : Microsoft.Compute/galleries
Location          : southcentralus
Tags              : {}

ResourceGroupName : rg2
Description       : Gallery created by PowerShell.
Identifier        : 
  UniqueName      : 00000000-0000-0000-0000-000000000000-gallery3
ProvisioningState : Succeeded
Id                : /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg2/providers/Microsoft.Compute/galleries/gallery3
Name              : gallery3
Type              : Microsoft.Compute/galleries
Location          : southcentralus
Tags              : {}

获取以“库”开头的订阅中的所有库。

示例 5

Get-AzGallery -Name galleryName -ResourceGroupName rg -Expand SharingProfile/Groups

获取库的共享配置文件。

参数

-Community

列出社区库。

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

-DefaultProfile

用于与 Azure 通信的凭据、帐户、租户和订阅。

Type:IAzureContextContainer
Aliases:AzContext, AzureRmContext, AzureCredential
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Expand

要应用于操作的展开查询选项。 可能的值(s):“SharingProfile/Groups”

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

-GalleryPublicName

共享映像库的公共名称。

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

-GalleryUniqueName

共享映像库的唯一名称。

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

-Location

共享映像库的位置。

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

-Name

库的名称。

Type:String
Aliases:GalleryName
Position:1
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:True

-ResourceGroupName

资源组的名称。

Type:String
Position:0
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:True

-ResourceId

库的资源 ID

Type:String
Position:0
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-Scope

指定共享到订阅或租户的库。

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

输入

String

输出

PSGallery