共用方式為


Get-AzPostgreSqlFlexibleServerConnectionString

根據客戶端連線提供者取得連接字串。

語法

Get-AzPostgreSqlFlexibleServerConnectionString
   -Client <String>
   -Name <String>
   -ResourceGroupName <String>
   [-SubscriptionId <String>]
   [-DefaultProfile <PSObject>]
   [<CommonParameters>]
Get-AzPostgreSqlFlexibleServerConnectionString
   -Client <String>
   -InputObject <IServerAutoGenerated>
   [-DefaultProfile <PSObject>]
   [<CommonParameters>]

Description

根據客戶端連線提供者取得連接字串。

範例

範例 1:依名稱取得連接字串

Get-AzPostgreSqlFlexibleServerConnectionString -Client ADO.NET -ResourceGroupName PowershellPostgreSqlTest -Name postgresql-test

Server=postgresql-test.postgres.database.azure.com;Database={your_database};Port=5432;User Id=adminuser;Password={your_password};

此 Cmdlet 會依伺服器名稱顯示客戶端的連接字串。

範例 2:依身分識別取得 PostgreSql 伺服器連接字串

Get-AzPostgreSqlFlexibleServer -ResourceGroupName PostgreSqlTestRG -ServerName PostgreSqlTestServer | Get-AzPostgreSqlFlexibleServerConnectionString -Client PHP

host=postgresqltestserver.postgres.database.azure.com port=5432 dbname={your_database} user=pwsh password={your_password} sslmode=require

此 Cmdlet 會依身分識別取得 PostgreSql 伺服器連接字串。

參數

-Client

用戶端連線提供者。

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

-DefaultProfile

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

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

-InputObject

連接字串的伺服器若要建構,請參閱 INPUTOBJECT 屬性的 NOTES 區段並建立哈希表。

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

-Name

伺服器的名稱。

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

-ResourceGroupName

包含資源的資源群組名稱,您可以從 Azure Resource Manager API 或入口網站取得此值。

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

-SubscriptionId

識別 Azure 訂用帳戶的訂用帳戶標識碼。

類型:String
Position:Named
預設值:(Get-AzContext).Subscription.Id
必要:False
接受管線輸入:False
接受萬用字元:False

輸入

輸出