共用方式為


Get-AzureRmRedisCacheLink

取得 Redis 快取的異地復寫連結。

警告

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

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

語法

Get-AzureRmRedisCacheLink
   -Name <String>
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]
Get-AzureRmRedisCacheLink
   -PrimaryServerName <String>
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]
Get-AzureRmRedisCacheLink
   -PrimaryServerName <String>
   -SecondaryServerName <String>
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]
Get-AzureRmRedisCacheLink
   -SecondaryServerName <String>
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]

Description

有四種不同的方式可取得異地復寫鏈接詳細數據。 提供參數 Name 或 PrimaryServerName 和/或 SecondaryServerName。 系統會提供名稱,然後會傳回快取存在的所有連結。 如果只指定 PrimaryServerName,則會傳回快取為主要的所有連結。 如果只指定 SecondaryServerName,則會傳回快取為次要的所有連結。 如果同時提供 PrimaryServerName 和 SecondaryServerName,則會傳回具有正確角色的特定連結。

範例

範例 1:使用參數集 AllLinksForCache 取得

PS C:\>Get-AzureRmRedisCacheLink -Name "mycache1"

        PrimaryServerName   : mycache1
        SecondaryServerName : mycache2
        ProvisioningState   : Succeeded

此命令會取得名為 mycache1 之 Redis 快取的所有異地復寫連結。

範例 2:使用參數 set AllLinksForPrimaryCache

PS C:\>Get-AzureRmRedisCacheLink -PrimaryServerName "mycache1"

        PrimaryServerName   : mycache1
        SecondaryServerName : mycache2
        ProvisioningState   : Succeeded

此命令會取得名為 mycache1 的 Redis 快取為主要位置的異地復寫連結。

範例 3:使用參數 set AllLinksForSecondaryCache

PS C:\>Get-AzureRmRedisCacheLink -SecondaryServerName "mycache2"

        PrimaryServerName   : mycache1
        SecondaryServerName : mycache2
        ProvisioningState   : Succeeded

此命令會取得名為 mycache2 的 Redis 快取是次要的異地復寫連結。

PS C:\>Get-AzureRmRedisCacheLink -PrimaryServerName "mycache1" -SecondaryServerName "mycache2"

        PrimaryServerName   : mycache1
        SecondaryServerName : mycache2
        ProvisioningState   : Succeeded

此命令會取得單一異地復寫連結,其中 Redis 快取名為 mycache1 是主要復寫,而名為 mycache2 的 Redis 快取則為次要。

參數

-DefaultProfile

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

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

-Name

redis 快取的名稱。

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

-PrimaryServerName

連結中主要 redis 快取的名稱。

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

-SecondaryServerName

連結中的次要 redis 快取名稱。

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

輸入

String

輸出

PSRedisLinkedServer