Get-AzPostgreSqlConnectionString
根據客戶端連線提供者取得連接字串。
語法
Get-AzPostgreSqlConnectionString
-Client <String>
-Name <String>
-ResourceGroupName <String>
[-SubscriptionId <String>]
[-DefaultProfile <PSObject>]
[<CommonParameters>]
Get-AzPostgreSqlConnectionString
-Client <String>
-InputObject <IServer>
[-DefaultProfile <PSObject>]
[<CommonParameters>]
Description
根據客戶端連線提供者取得連接字串。
範例
範例 1:依資源群組和伺服器名稱取得 PostgreSql 伺服器連接字串
Get-AzPostgreSqlConnectionString -Client ADO.NET -Name PostgreSqlTestServer -ResourceGroupName PostgreSqlTestRG
Server=postgresqltestserver.postgres.database.azure.com;Database={your_database};Port=5432;User Id=pwsh@postgresqltestserver;Password={your_password};Ssl Mode=Require;
此 Cmdlet 會依資源群組和伺服器名稱取得 PostgreSql 伺服器連接字串。
範例 2:依身分識別取得 PostgreSql 伺服器連接字串
Get-AzPostgreSqlServer -ResourceGroupName PostgreSqlTestRG -ServerName PostgreSqlTestServer | Get-AzPostgreSqlConnectionString -Client PHP
host=postgresqltestserver.postgres.database.azure.com port=5432 dbname={your_database} user=pwsh@postgresqltestserver 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 區段並建立哈希表。
類型: | IServer |
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 |