Skip to content

Commit 46b8eb0

Browse files
added new command Get Powe Platform Connectors.
1 parent 8d9c8ae commit 46b8eb0

29 files changed

+730
-0
lines changed
Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
---
2+
Module Name: PnP.PowerShell
3+
schema: 2.0.0
4+
applicable: SharePoint Online
5+
online version: https://pnp.github.io/powershell/cmdlets/Get-PnPPowerPlatformConnectors.html
6+
external help file: PnP.PowerShell.dll-Help.xml
7+
title: Get-PnPPowerPlatformConnectors
8+
---
9+
10+
# Get-PnPPowerPlatformConnectors
11+
12+
## SYNOPSIS
13+
14+
**Required Permissions**
15+
16+
* Azure: management.azure.com
17+
18+
Returns the Custom Power Platform Connectors for a given environment
19+
20+
## SYNTAX
21+
22+
```powershell
23+
Get-PnPPowerPlatformConnectors [-Environment <PowerPlatformEnvironmentPipeBind>] [-AsAdmin] [-Identity <PowerPlatformConnectorPipeBind>]
24+
[-Connection <PnPConnection>] [-Verbose]
25+
```
26+
27+
## DESCRIPTION
28+
This cmdlet returns the custom connectors on a given enviroment.
29+
30+
## EXAMPLES
31+
32+
### Example 1
33+
```powershell
34+
$environment = Get-PnPPowerPlatformEnvironment
35+
Get-PnPPowerPlatformConnectors -Environment $environment
36+
```
37+
This returns all the custom connectors for a given Power Platform environment
38+
39+
### Example 2
40+
```powershell
41+
$environment = Get-PnPPowerPlatformEnvironment
42+
Get-PowerPlatformConnectorPipeBind -Environment $environment -Identity fba63225-baf9-4d76-86a1-1b42c917a182
43+
```
44+
This returns a specific custom connector
45+
46+
## PARAMETERS
47+
48+
### -Environment
49+
The name of the Power Platform environment or an Environment object to retrieve the available custom connectors for.
50+
51+
```yaml
52+
Type: PowerPlatformEnvironmentPipeBind
53+
Parameter Sets: (All)
54+
Aliases:
55+
56+
Required: False
57+
Position: Named
58+
Default value: The default environment
59+
Accept pipeline input: True
60+
Accept wildcard characters: False
61+
```
62+
63+
### -Identity
64+
The Id of the connector to retrieve.
65+
66+
```yaml
67+
Type: PowerPlatformConnectorPipeBind
68+
Parameter Sets: (All)
69+
Aliases:
70+
71+
Required: False
72+
Position: Named
73+
Default value: None
74+
Accept pipeline input: False
75+
Accept wildcard characters: False
76+
```
77+
78+
### -AsAdmin
79+
If specified returns all the custom connectors as admin. If not specified only the custom connectors for the current user will be returned.
80+
81+
```yaml
82+
Type: SwitchParameter
83+
Parameter Sets: (All)
84+
Aliases:
85+
86+
Required: False
87+
Position: Named
88+
Default value: None
89+
Accept pipeline input: False
90+
Accept wildcard characters: False
91+
```
92+
93+
### -Connection
94+
Optional connection to be used by the cmdlet.
95+
Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.
96+
97+
```yaml
98+
Type: PnPConnection
99+
Parameter Sets: (All)
100+
Aliases:
101+
102+
Required: False
103+
Position: Named
104+
Default value: None
105+
Accept pipeline input: False
106+
Accept wildcard characters: False
107+
```
108+
109+
### -Verbose
110+
When provided, additional debug statements will be shown while executing the cmdlet.
111+
112+
```yaml
113+
Type: SwitchParameter
114+
Parameter Sets: (All)
115+
116+
Required: False
117+
Position: Named
118+
Default value: None
119+
Accept pipeline input: False
120+
Accept wildcard characters: False
121+
```
122+
123+
## RELATED LINKS
124+
125+
[Microsoft 365 Patterns and Practices](https://aka.ms/m365pnp)
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
namespace PnP.PowerShell.Commands.Base.PipeBinds
2+
{
3+
public sealed class PowerPlatformConnectorPipeBind
4+
{
5+
private readonly string _name;
6+
private readonly Model.PowerPlatform.Environment.PowerPlatformConnector _connector;
7+
public PowerPlatformConnectorPipeBind(string input)
8+
{
9+
_name = input;
10+
}
11+
12+
public PowerPlatformConnectorPipeBind(Model.PowerPlatform.Environment.PowerPlatformConnector connector)
13+
{
14+
_connector = connector;
15+
}
16+
17+
public string GetName()
18+
{
19+
if (_connector != null)
20+
{
21+
return _connector.Name;
22+
}
23+
return _name;
24+
}
25+
}
26+
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
using PnP.Framework.Extensions;
2+
using System.Text.Json.Serialization;
3+
4+
namespace PnP.PowerShell.Commands.Model.PowerPlatform.Environment
5+
{
6+
public class PowerPlatformConnector
7+
{
8+
/// <summary>
9+
/// Name of the connector as its GUID
10+
/// </summary>
11+
[JsonPropertyName("name")]
12+
public string Name { get; set; }
13+
/// <summary>
14+
/// Unique identifier of this connector.
15+
/// </summary>
16+
[JsonPropertyName("id")]
17+
public string Id { get; set; }
18+
/// <summary>
19+
/// Type of object, typically Microsoft.PowerApps/apis
20+
/// </summary>
21+
[JsonPropertyName("type")]
22+
public string Type { get; set; }
23+
/// <summary>
24+
/// Additional information on the Connector
25+
/// </summary>
26+
[JsonPropertyName("properties")]
27+
public PowerPlatformConnectorProperties Properties { get; set; }
28+
public bool IsCustomConnector
29+
{
30+
get { return Properties.isCustomApi; }
31+
}
32+
public string DisplayName
33+
{
34+
get { return Properties.displayName; }
35+
}
36+
}
37+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
using System.Text.Json.Serialization;
2+
3+
namespace PnP.PowerShell.Commands.Model.PowerPlatform.Environment
4+
{
5+
public class PowerPlatformConnectorApiDefinitions
6+
{
7+
[JsonPropertyName("originalSwaggerUrl")]
8+
public string originalSwaggerUrl { get; set; }
9+
10+
[JsonPropertyName("modifiedSwaggerUrl")]
11+
public string modifiedSwaggerUrl { get; set; }
12+
}
13+
14+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
using System.Text.Json.Serialization;
2+
3+
namespace PnP.PowerShell.Commands.Model.PowerPlatform.Environment
4+
{
5+
public class PowerPlatformConnectorAuthorizationUrl
6+
{
7+
[JsonPropertyName("value")]
8+
public string value { get; set; }
9+
}
10+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
using System.Text.Json.Serialization;
2+
3+
namespace PnP.PowerShell.Commands.Model.PowerPlatform.Environment
4+
{
5+
public class PowerPlatformConnectorBackendService
6+
{
7+
[JsonPropertyName("serviceUrl")]
8+
public string serviceUrl { get; set; }
9+
}
10+
11+
12+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
using System.Text.Json.Serialization;
2+
3+
namespace PnP.PowerShell.Commands.Model.PowerPlatform.Environment
4+
{
5+
public class PowerPlatformConnectorConnectionParameters
6+
{
7+
[JsonPropertyName("token")]
8+
public PowerPlatformConnectorToken token { get; set; }
9+
10+
[JsonPropertyName("token:TenantId")]
11+
public PowerPlatformConnectorTokenTenantId tokenTenantId { get; set; }
12+
}
13+
14+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
using System.Text.Json.Serialization;
2+
3+
namespace PnP.PowerShell.Commands.Model.PowerPlatform.Environment
4+
{
5+
public class PowerPlatformConnectorConstraints
6+
{
7+
[JsonPropertyName("required")]
8+
public string required { get; set; }
9+
10+
[JsonPropertyName("hidden")]
11+
public string hidden { get; set; }
12+
}
13+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
//namespace PnP.PowerShell.Commands.Model.PowerPlatform.Environment
2+
//{
3+
// public class PowerPlatformConnectorContact
4+
// {
5+
// }
6+
//}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
using System.Text.Json.Serialization;
2+
3+
namespace PnP.PowerShell.Commands.Model.PowerPlatform.Environment
4+
{
5+
public class PowerPlatformConnectorCreatedBy
6+
{
7+
[JsonPropertyName("id")]
8+
public string id { get; set; }
9+
10+
[JsonPropertyName("displayName")]
11+
public string displayName { get; set; }
12+
13+
[JsonPropertyName("email")]
14+
public string email { get; set; }
15+
16+
[JsonPropertyName("type")]
17+
public string type { get; set; }
18+
19+
[JsonPropertyName("tenantId")]
20+
public string tenantId { get; set; }
21+
22+
[JsonPropertyName("userPrincipalName")]
23+
public string userPrincipalName { get; set; }
24+
}
25+
}

0 commit comments

Comments
 (0)