共用方式為


Get-AzureRmVMExtension

取得安裝在虛擬機上的虛擬機擴充功能屬性。

警告

自 2024 年 2 月 29 日起,AzureRM PowerShell 模組已正式淘汰。 建議使用者從 AzureRM 遷移至 Az PowerShell 模組,以確保持續支援和更新。

雖然 AzureRM 模組可能仍可運作,但不再維護或支援它,但會根據用戶的判斷權和風險放置任何繼續使用。 如需轉換至 Az 模組的指引,請參閱我們的 移轉資源

語法

Get-AzureRmVMExtension
   [-ResourceGroupName] <String>
   [-VMName] <String>
   [-Name] <String>
   [-Status]
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]

Description

Get-AzureRmVMExtension Cmdlet 會取得虛擬機擴充功能的屬性安裝在虛擬機上。 指定要取得屬性的延伸模組名稱。 若要只取得延伸模組的實例檢視,請指定 Status 參數。

範例

範例 1:取得延伸模組的屬性

PS C:\> Get-AzureRmVMExtension -ResourceGroupName "ResourceGroup11" -VMName "VirtualMachine22" -Name "CustomScriptExtension"

此命令會取得資源群組 ResourceGroup11 中名為 VirtualMachine22 的虛擬機上名為 CustomScriptExtension 的擴充功能屬性。

範例 2:取得延伸模組的實例檢視

PS C:\> Get-AzureRmVMExtension -ResourceGroupName "ResourceGroup11" -VMName "VirtualMachine22" -Name "CustomScriptExtension" -Status

此命令會在資源群組 ResourceGroup11 中名為 VirtualMachine22 的虛擬機上,取得名為 CustomScriptExtension 的擴充功能的實例檢視。

參數

-DefaultProfile

用於與 azure 通訊的認證、帳戶、租用戶和訂用帳戶。

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

-Name

指定延伸模組的名稱。 這個 Cmdlet 會取得此參數所指定之延伸模組的屬性。

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

-ResourceGroupName

指定資源群組的名稱。

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

-Status

表示此 Cmdlet 只會取得延伸模組的實例檢視。

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

-VMName

指定虛擬機的名稱。 這個 Cmdlet 會從此參數指定的虛擬機取得擴充功能的屬性。

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

輸入

String

SwitchParameter

輸出

PSVirtualMachineExtension