Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* text=auto
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
bin
obj
.vs
generated
internal
exports
tools
test/*-TestResults.xml
license.txt
/*.ps1
/*.psd1
/*.ps1xml
/*.psm1
/*.snk
/*.csproj
/*.nuspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the Apache License, Version 2.0 (the ""License"");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an ""AS IS"" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code
// is regenerated.

using System;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

[assembly: System.Reflection.AssemblyCompanyAttribute("Microsoft")]
[assembly: System.Reflection.AssemblyCopyrightAttribute("Copyright © Microsoft")]
[assembly: System.Reflection.AssemblyProductAttribute("Microsoft Azure PowerShell")]
[assembly: System.Reflection.AssemblyTitleAttribute("Microsoft Azure PowerShell - PostgreSqlFlexibleServer")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("0.1.0")]
[assembly: System.Reflection.AssemblyVersionAttribute("0.1.0")]
[assembly: System.Runtime.InteropServices.ComVisibleAttribute(false)]
[assembly: System.CLSCompliantAttribute(false)]

Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
<!-- region Generated -->
# Az.PostgreSqlFlexibleServer
This directory contains the PowerShell module for the PostgreSqlFlexibleServer service.

---
## Info
- Modifiable: yes
- Generated: all
- Committed: yes
- Packaged: yes

---
## Detail
This module was primarily generated via [AutoRest](https://github.com/Azure/autorest) using the [PowerShell](https://github.com/Azure/autorest.powershell) extension.

## Module Requirements
- [Az.Accounts module](https://www.powershellgallery.com/packages/Az.Accounts/), version 2.7.5 or greater

## Authentication
AutoRest does not generate authentication code for the module. Authentication is handled via Az.Accounts by altering the HTTP payload before it is sent.

## Development
For information on how to develop for `Az.PostgreSqlFlexibleServer`, see [how-to.md](how-to.md).
<!-- endregion -->

# Az.PostgreSQLFlexibleServer

This directory contains the PowerShell module for the Azure Database for PostgreSQL Flexible Server service.

## AutoRest Configuration

> see [autorest](https://aka.ms/autorest)

```yaml
# pin the swagger version by using the commit id instead of branch name
commit: be31c7768b25795ee6aadd24783100254499c845
repo: https://github.com/Azure/azure-rest-api-specs
require:
# readme.azure.noprofile.md is the common configuration file
- $(this-folder)/../../readme.azure.noprofile.md
- $(repo)/specification/postgresql/resource-manager/readme.md

# For new RP, the version is 0.1.0
module-version: 0.1.0
# Normally, title is the service name
title: PostgreSQLFlexibleServer
subject-prefix: PostgreSQLFlexibleServer
input-file:
- $(repo)/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2025-08-01/openapi.json

use:
- "@autorest/powershell@latest"

directive:
# Fix SecureString type conversion issues in BackupStoreDetails
# AutoRest generates direct string to SecureString casts which are invalid
# Replace invalid cast with proper SecureString creation helper method
- from: BackupStoreDetails.json.cs
where: $
transform: |
return $.replace(
/\(System\.Security\.SecureString\)\(__t\.ToString\(\)\)/g,
'ConvertToSecureString(__t.ToString())'
).replace(
/(namespace [^{]+\{[\s\S]*?)(internal BackupStoreDetails)/,
'$1\n private static System.Security.SecureString ConvertToSecureString(string value)\n {\n if (string.IsNullOrEmpty(value)) return null;\n var secureString = new System.Security.SecureString();\n foreach (char c in value)\n {\n secureString.AppendChar(c);\n }\n secureString.MakeReadOnly();\n return secureString;\n }\n\n $2'
);

# Following are common directives which are normally required in all the RPs
# 1. Remove the unexpanded parameter set
# 2. For New-* cmdlets, ViaIdentity is not required
# Following two directives are v4 specific
- where:
variant: ^(Create|Update)(?!.*?(Expanded|JsonFilePath|JsonString))
remove: true
- where:
variant: ^CreateViaIdentity$|^CreateViaIdentityExpanded$
remove: true

# Remove the set-* cmdlet
- where:
verb: Set
remove: true
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
{
"resourceType": "flexibleServers/administrators",
"apiVersion": "2025-08-01",
"learnMore": {
"url": "https://learn.microsoft.com/powershell/module/az.postgresqlflexibleserver"
},
"commands": [
{
"name": "Get-AzPostgreSqlFlexibleServerAdministratorsMicrosoftEntra",
"description": "Gets information about a server administrator associated to a Microsoft Entra principal.",
"path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/administrators/{objectId}",
"help": {
"learnMore": {
"url": "https://learn.microsoft.com/powershell/module/az.postgresqlflexibleserver/get-azpostgresqlflexibleserveradministratorsmicrosoftentra"
},
"parameterSets": [
{
"parameters": [
"-ObjectId <String>",
"-ResourceGroupName <String>",
"-ServerName <String>",
"[-SubscriptionId <String[]>]"
]
}
]
},
"examples": [
{
"description": "Gets information about a server administrator associated to a Microsoft Entra principal.",
"parameters": [
{
"name": "-ObjectId",
"value": "[Path.objectId]"
},
{
"name": "-ResourceGroupName",
"value": "[Path.resourceGroupName]"
},
{
"name": "-ServerName",
"value": "[Path.serverName]"
},
{
"name": "-SubscriptionId",
"value": "[Path.subscriptionId]"
}
]
}
]
},
{
"name": "Remove-AzPostgreSqlFlexibleServerAdministratorsMicrosoftEntra",
"description": "Deletes an existing server administrator associated to a Microsoft Entra principal.",
"path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/administrators/{objectId}",
"help": {
"learnMore": {
"url": "https://learn.microsoft.com/powershell/module/az.postgresqlflexibleserver/remove-azpostgresqlflexibleserveradministratorsmicrosoftentra"
},
"parameterSets": [
{
"parameters": [
"-ObjectId <String>",
"-ResourceGroupName <String>",
"-ServerName <String>",
"[-SubscriptionId <String>]"
]
}
]
},
"examples": [
{
"description": "Deletes an existing server administrator associated to a Microsoft Entra principal.",
"parameters": [
{
"name": "-ObjectId",
"value": "[Path.objectId]"
},
{
"name": "-ResourceGroupName",
"value": "[Path.resourceGroupName]"
},
{
"name": "-ServerName",
"value": "[Path.serverName]"
},
{
"name": "-SubscriptionId",
"value": "[Path.subscriptionId]"
}
]
}
]
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{
"resourceType": "flexibleServers/advancedThreatProtectionSettings",
"apiVersion": "2025-08-01",
"learnMore": {
"url": "https://learn.microsoft.com/powershell/module/az.postgresqlflexibleserver"
},
"commands": [
{
"name": "Get-AzPostgreSqlFlexibleServerAdvancedThreatProtectionSetting",
"description": "Gets state of advanced threat protection settings for a server.",
"path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/advancedThreatProtectionSettings/{threatProtectionName}",
"help": {
"learnMore": {
"url": "https://learn.microsoft.com/powershell/module/az.postgresqlflexibleserver/get-azpostgresqlflexibleserveradvancedthreatprotectionsetting"
},
"parameterSets": [
{
"parameters": [
"-ResourceGroupName <String>",
"-ServerName <String>",
"[-SubscriptionId <String[]>]"
]
}
]
},
"examples": [
{
"description": "Gets state of advanced threat protection settings for a server.",
"parameters": [
{
"name": "-ResourceGroupName",
"value": "[Path.resourceGroupName]"
},
{
"name": "-ServerName",
"value": "[Path.serverName]"
},
{
"name": "-SubscriptionId",
"value": "[Path.subscriptionId]"
}
]
}
]
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
{
"resourceType": "flexibleServers/backups",
"apiVersion": "2025-08-01",
"learnMore": {
"url": "https://learn.microsoft.com/powershell/module/az.postgresqlflexibleserver"
},
"commands": [
{
"name": "Get-AzPostgreSqlFlexibleServerBackupsAutomaticAndOnDemand",
"description": "Gets information of an on demand backup, given its name.",
"path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/backups/{backupName}",
"help": {
"learnMore": {
"url": "https://learn.microsoft.com/powershell/module/az.postgresqlflexibleserver/get-azpostgresqlflexibleserverbackupsautomaticandondemand"
},
"parameterSets": [
{
"parameters": [
"-BackupName <String>",
"-ResourceGroupName <String>",
"-ServerName <String>",
"[-SubscriptionId <String[]>]"
]
}
]
},
"examples": [
{
"description": "Gets information of an on demand backup, given its name.",
"parameters": [
{
"name": "-BackupName",
"value": "[Path.backupName]"
},
{
"name": "-ResourceGroupName",
"value": "[Path.resourceGroupName]"
},
{
"name": "-ServerName",
"value": "[Path.serverName]"
},
{
"name": "-SubscriptionId",
"value": "[Path.subscriptionId]"
}
]
}
]
},
{
"name": "Remove-AzPostgreSqlFlexibleServerBackupsAutomaticAndOnDemand",
"description": "Deletes a specific backup, given its name.",
"path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/backups/{backupName}",
"help": {
"learnMore": {
"url": "https://learn.microsoft.com/powershell/module/az.postgresqlflexibleserver/remove-azpostgresqlflexibleserverbackupsautomaticandondemand"
},
"parameterSets": [
{
"parameters": [
"-BackupName <String>",
"-ResourceGroupName <String>",
"-ServerName <String>",
"[-SubscriptionId <String>]"
]
}
]
},
"examples": [
{
"description": "Deletes a specific backup, given its name.",
"parameters": [
{
"name": "-BackupName",
"value": "[Path.backupName]"
},
{
"name": "-ResourceGroupName",
"value": "[Path.resourceGroupName]"
},
{
"name": "-ServerName",
"value": "[Path.serverName]"
},
{
"name": "-SubscriptionId",
"value": "[Path.subscriptionId]"
}
]
}
]
}
]
}
Loading
Loading