共用方式為


Get-AzureRmResourceLock

取得資源鎖定。

警告

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

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

語法

Get-AzureRmResourceLock
   [-LockName <String>]
   [-AtScope]
   -ResourceGroupName <String>
   [-ApiVersion <String>]
   [-Pre]
   [-DefaultProfile <IAzureContextContainer>]
   [-InformationAction <ActionPreference>]
   [-InformationVariable <String>]
   [<CommonParameters>]
Get-AzureRmResourceLock
   [-LockName <String>]
   [-AtScope]
   -ResourceName <String>
   -ResourceType <String>
   -ResourceGroupName <String>
   [-ApiVersion <String>]
   [-Pre]
   [-DefaultProfile <IAzureContextContainer>]
   [-InformationAction <ActionPreference>]
   [-InformationVariable <String>]
   [<CommonParameters>]
Get-AzureRmResourceLock
   [-LockName <String>]
   [-AtScope]
   -Scope <String>
   [-ApiVersion <String>]
   [-Pre]
   [-DefaultProfile <IAzureContextContainer>]
   [-InformationAction <ActionPreference>]
   [-InformationVariable <String>]
   [<CommonParameters>]
Get-AzureRmResourceLock
   [-LockName <String>]
   [-AtScope]
   [-ApiVersion <String>]
   [-Pre]
   [-DefaultProfile <IAzureContextContainer>]
   [-InformationAction <ActionPreference>]
   [-InformationVariable <String>]
   [<CommonParameters>]
Get-AzureRmResourceLock
   [-LockName <String>]
   [-AtScope]
   -ResourceName <String>
   -ResourceType <String>
   [-ApiVersion <String>]
   [-Pre]
   [-DefaultProfile <IAzureContextContainer>]
   [-InformationAction <ActionPreference>]
   [-InformationVariable <String>]
   [<CommonParameters>]
Get-AzureRmResourceLock
   [-LockName <String>]
   [-AtScope]
   -ResourceName <String>
   -ResourceType <String>
   [-TenantLevel]
   [-ApiVersion <String>]
   [-Pre]
   [-DefaultProfile <IAzureContextContainer>]
   [-InformationAction <ActionPreference>]
   [-InformationVariable <String>]
   [<CommonParameters>]
Get-AzureRmResourceLock
   [-AtScope]
   -LockId <String>
   [-ApiVersion <String>]
   [-Pre]
   [-DefaultProfile <IAzureContextContainer>]
   [-InformationAction <ActionPreference>]
   [-InformationVariable <String>]
   [<CommonParameters>]

Description

Get-AzureRmResourceLock Cmdlet 會取得 Azure 資源鎖定。

範例

範例 1:取得鎖定

PS C:\>Get-AzureRmResourceLock -LockName "ContosoSiteLock" -ResourceName "ContosoSite" -ResourceType "microsoft.web/sites" -ResourceGroupName "ResourceGroup11"

此命令會取得名為 ContosoSiteLock 的資源鎖定。

參數

-ApiVersion

指定要使用的資源提供者 API 版本。 如果您未指定版本,此 Cmdlet 會使用最新的可用版本。

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

-AtScope

表示此 Cmdlet 會傳回指定範圍或上方的所有鎖定。 如果您未指定此參數,Cmdlet 會傳回範圍下方、上方或下方的所有鎖定。

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

-DefaultProfile

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

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

-InformationAction

指定此 Cmdlet 如何回應資訊事件。 此參數可接受的值為:

  • 繼續
  • 忽略
  • 詢問
  • SilentlyContinue
  • 停止
  • 暫止
類型:ActionPreference
別名:infa
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-InformationVariable

指定資訊變數。

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

-LockId

指定這個 Cmdlet 取得之鎖定的標識碼。

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

-LockName

指定這個 Cmdlet 取得的鎖定名稱。

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

-Pre

指出此 Cmdlet 會在自動判斷要使用的版本時,考慮發行前版本 API 版本。

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

-ResourceGroupName

指定套用鎖定的資源群組名稱。 此 Cmdlet 會取得此資源群組的鎖定。

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

-ResourceName

指定套用此鎖定的資源名稱。 此 Cmdlet 會取得此資源的鎖定。

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

-ResourceType

指定套用此鎖定之資源的資源類型。 此 Cmdlet 會取得此資源的鎖定。

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

-Scope

指定套用鎖定的範圍。 Cmdlet 會取得此範圍的鎖定。

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

-TenantLevel

表示此 Cmdlet 會在租用戶層級運作。

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