共用方式為


Get-AzureStorSimpleResource

取得您建立的所有資源。

注意

本文件中參考的 Cmdlet 用於管理使用 Azure Service Manager(ASM) API 的舊版 Azure 資源。 建立新的資源時,不建議使用此舊版 PowerShell 模組,因為 ASM 已排定淘汰。 如需詳細資訊,請參閱 Azure Service Manager 淘汰

Az PowerShell 模組是使用 PowerShell 管理 Azure Resource Manager (ARM) 資源的建議 PowerShell 模組。

語法

Get-AzureStorSimpleResource
   [-ResourceName <String>]
   [-Profile <AzureSMProfile>]
   [<CommonParameters>]

Description

Get-AzureStorSimpleResource Cmdlet 會取得您使用 Azure 入口網站建立的所有資源。 Cmdlet 會取得可用來連線到資源的詳細數據。

範例

範例 1:取得所有資源

PS C:\>Get-AzureStorSimpleResource
VERBOSE: ClientRequestId: 5cd61b91-ef40-43b4-986d-156e06d2ed65_PS

ResourceName                                      ResourceId           ResourceState
------------                                      ----------           -------------
Contoso63-Tsqa                                    8838459798595306468  Started
Contoso68-Tsqa                                    2859070203638134681  Started
Contoso73-Tsqa                                    7871392677286863733  Started
Contoso87-Tsqa                                    1909806764156522689  Started
VERBOSE: Found 4 StorSimple resources.

此命令會取得您建立的所有資源。 在此範例中,有三個資源。

範例 2:使用其名稱取得資源

PS C:\>Get-AzureStorSimpleResource -ResourceName "Contoso63-Tsqa"
VERBOSE: ClientRequestId: efc3c85c-12aa-4345-b6eb-ccc532de4825_PS

ResourceName                                      ResourceId           ResourceState
------------                                      ----------           -------------
Contoso63-Tsqa                                    1909806764156522689  Started
VERBOSE: Found 1 StorSimple resource.

此命令會取得名為 Contoso63-Tsqa 的資源。

範例 3:嘗試取得不存在的資源

PS C:\>Get-AzureStorSimpleResource -ResourceName "Contoso64-Tsqa"
VERBOSE: ClientRequestId: 5d08d40b-f9d7-4d43-956f-13f01e89625b_PS
VERBOSE: Invalid input : Could not find a resource named Contoso64-Tsqa in your subscription.

此命令會嘗試取得名為 Contoso64-Tsqa 的資源。 沒有具有此名稱的資源。 此範例不會傳回任何資源。

參數

-Profile

指定 Azure 設定檔。

類型:AzureSMProfile
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-ResourceName

指定這個 Cmdlet 取得的資源名稱。

類型:String
別名:Name
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

輸入

None

輸出

IEnumerable\<ResourceCredentials\>, ResourceCredentials

此 Cmdlet 會傳 回包含下列屬性的 ResourceCredentials 物件:

  • ResourceName
  • ResouceId
  • ResourceState