forked from pnp/powershell
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added new command Get Powe Platform Connectors.
- Loading branch information
1 parent
8d9c8ae
commit 46b8eb0
Showing
29 changed files
with
730 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,125 @@ | ||
--- | ||
Module Name: PnP.PowerShell | ||
schema: 2.0.0 | ||
applicable: SharePoint Online | ||
online version: https://pnp.github.io/powershell/cmdlets/Get-PnPPowerPlatformConnectors.html | ||
external help file: PnP.PowerShell.dll-Help.xml | ||
title: Get-PnPPowerPlatformConnectors | ||
--- | ||
|
||
# Get-PnPPowerPlatformConnectors | ||
|
||
## SYNOPSIS | ||
|
||
**Required Permissions** | ||
|
||
* Azure: management.azure.com | ||
|
||
Returns the Custom Power Platform Connectors for a given environment | ||
|
||
## SYNTAX | ||
|
||
```powershell | ||
Get-PnPPowerPlatformConnectors [-Environment <PowerPlatformEnvironmentPipeBind>] [-AsAdmin] [-Identity <PowerPlatformConnectorPipeBind>] | ||
[-Connection <PnPConnection>] [-Verbose] | ||
``` | ||
|
||
## DESCRIPTION | ||
This cmdlet returns the custom connectors on a given enviroment. | ||
|
||
## EXAMPLES | ||
|
||
### Example 1 | ||
```powershell | ||
$environment = Get-PnPPowerPlatformEnvironment | ||
Get-PnPPowerPlatformConnectors -Environment $environment | ||
``` | ||
This returns all the custom connectors for a given Power Platform environment | ||
|
||
### Example 2 | ||
```powershell | ||
$environment = Get-PnPPowerPlatformEnvironment | ||
Get-PowerPlatformConnectorPipeBind -Environment $environment -Identity fba63225-baf9-4d76-86a1-1b42c917a182 | ||
``` | ||
This returns a specific custom connector | ||
|
||
## PARAMETERS | ||
|
||
### -Environment | ||
The name of the Power Platform environment or an Environment object to retrieve the available custom connectors for. | ||
|
||
```yaml | ||
Type: PowerPlatformEnvironmentPipeBind | ||
Parameter Sets: (All) | ||
Aliases: | ||
|
||
Required: False | ||
Position: Named | ||
Default value: The default environment | ||
Accept pipeline input: True | ||
Accept wildcard characters: False | ||
``` | ||
### -Identity | ||
The Id of the connector to retrieve. | ||
```yaml | ||
Type: PowerPlatformConnectorPipeBind | ||
Parameter Sets: (All) | ||
Aliases: | ||
|
||
Required: False | ||
Position: Named | ||
Default value: None | ||
Accept pipeline input: False | ||
Accept wildcard characters: False | ||
``` | ||
### -AsAdmin | ||
If specified returns all the custom connectors as admin. If not specified only the custom connectors for the current user will be returned. | ||
```yaml | ||
Type: SwitchParameter | ||
Parameter Sets: (All) | ||
Aliases: | ||
|
||
Required: False | ||
Position: Named | ||
Default value: None | ||
Accept pipeline input: False | ||
Accept wildcard characters: False | ||
``` | ||
### -Connection | ||
Optional connection to be used by the cmdlet. | ||
Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. | ||
```yaml | ||
Type: PnPConnection | ||
Parameter Sets: (All) | ||
Aliases: | ||
|
||
Required: False | ||
Position: Named | ||
Default value: None | ||
Accept pipeline input: False | ||
Accept wildcard characters: False | ||
``` | ||
### -Verbose | ||
When provided, additional debug statements will be shown while executing the cmdlet. | ||
```yaml | ||
Type: SwitchParameter | ||
Parameter Sets: (All) | ||
|
||
Required: False | ||
Position: Named | ||
Default value: None | ||
Accept pipeline input: False | ||
Accept wildcard characters: False | ||
``` | ||
## RELATED LINKS | ||
[Microsoft 365 Patterns and Practices](https://aka.ms/m365pnp) |
26 changes: 26 additions & 0 deletions
26
src/Commands/Base/PipeBinds/PowerPlatformConnectorPipeBind.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
namespace PnP.PowerShell.Commands.Base.PipeBinds | ||
{ | ||
public sealed class PowerPlatformConnectorPipeBind | ||
{ | ||
private readonly string _name; | ||
private readonly Model.PowerPlatform.Environment.PowerPlatformConnector _connector; | ||
public PowerPlatformConnectorPipeBind(string input) | ||
{ | ||
_name = input; | ||
} | ||
|
||
public PowerPlatformConnectorPipeBind(Model.PowerPlatform.Environment.PowerPlatformConnector connector) | ||
{ | ||
_connector = connector; | ||
} | ||
|
||
public string GetName() | ||
{ | ||
if (_connector != null) | ||
{ | ||
return _connector.Name; | ||
} | ||
return _name; | ||
} | ||
} | ||
} |
37 changes: 37 additions & 0 deletions
37
src/Commands/Model/PowerPlatform/Environment/Connector/PowerPlatformConnector.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
using PnP.Framework.Extensions; | ||
using System.Text.Json.Serialization; | ||
|
||
namespace PnP.PowerShell.Commands.Model.PowerPlatform.Environment | ||
{ | ||
public class PowerPlatformConnector | ||
{ | ||
/// <summary> | ||
/// Name of the connector as its GUID | ||
/// </summary> | ||
[JsonPropertyName("name")] | ||
public string Name { get; set; } | ||
/// <summary> | ||
/// Unique identifier of this connector. | ||
/// </summary> | ||
[JsonPropertyName("id")] | ||
public string Id { get; set; } | ||
/// <summary> | ||
/// Type of object, typically Microsoft.PowerApps/apis | ||
/// </summary> | ||
[JsonPropertyName("type")] | ||
public string Type { get; set; } | ||
/// <summary> | ||
/// Additional information on the Connector | ||
/// </summary> | ||
[JsonPropertyName("properties")] | ||
public PowerPlatformConnectorProperties Properties { get; set; } | ||
public bool IsCustomConnector | ||
{ | ||
get { return Properties.isCustomApi; } | ||
} | ||
public string DisplayName | ||
{ | ||
get { return Properties.displayName; } | ||
} | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
...ommands/Model/PowerPlatform/Environment/Connector/PowerPlatformConnectorApiDefinitions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
using System.Text.Json.Serialization; | ||
|
||
namespace PnP.PowerShell.Commands.Model.PowerPlatform.Environment | ||
{ | ||
public class PowerPlatformConnectorApiDefinitions | ||
{ | ||
[JsonPropertyName("originalSwaggerUrl")] | ||
public string originalSwaggerUrl { get; set; } | ||
|
||
[JsonPropertyName("modifiedSwaggerUrl")] | ||
public string modifiedSwaggerUrl { get; set; } | ||
} | ||
|
||
} |
10 changes: 10 additions & 0 deletions
10
...mands/Model/PowerPlatform/Environment/Connector/PowerPlatformConnectorAuthorizationUrl.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
using System.Text.Json.Serialization; | ||
|
||
namespace PnP.PowerShell.Commands.Model.PowerPlatform.Environment | ||
{ | ||
public class PowerPlatformConnectorAuthorizationUrl | ||
{ | ||
[JsonPropertyName("value")] | ||
public string value { get; set; } | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
...ommands/Model/PowerPlatform/Environment/Connector/PowerPlatformConnectorBackendService.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
using System.Text.Json.Serialization; | ||
|
||
namespace PnP.PowerShell.Commands.Model.PowerPlatform.Environment | ||
{ | ||
public class PowerPlatformConnectorBackendService | ||
{ | ||
[JsonPropertyName("serviceUrl")] | ||
public string serviceUrl { get; set; } | ||
} | ||
|
||
|
||
} |
14 changes: 14 additions & 0 deletions
14
...s/Model/PowerPlatform/Environment/Connector/PowerPlatformConnectorConnectionParameters.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
using System.Text.Json.Serialization; | ||
|
||
namespace PnP.PowerShell.Commands.Model.PowerPlatform.Environment | ||
{ | ||
public class PowerPlatformConnectorConnectionParameters | ||
{ | ||
[JsonPropertyName("token")] | ||
public PowerPlatformConnectorToken token { get; set; } | ||
|
||
[JsonPropertyName("token:TenantId")] | ||
public PowerPlatformConnectorTokenTenantId tokenTenantId { get; set; } | ||
} | ||
|
||
} |
13 changes: 13 additions & 0 deletions
13
src/Commands/Model/PowerPlatform/Environment/Connector/PowerPlatformConnectorConstraints.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
using System.Text.Json.Serialization; | ||
|
||
namespace PnP.PowerShell.Commands.Model.PowerPlatform.Environment | ||
{ | ||
public class PowerPlatformConnectorConstraints | ||
{ | ||
[JsonPropertyName("required")] | ||
public string required { get; set; } | ||
|
||
[JsonPropertyName("hidden")] | ||
public string hidden { get; set; } | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
src/Commands/Model/PowerPlatform/Environment/Connector/PowerPlatformConnectorContact.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
//namespace PnP.PowerShell.Commands.Model.PowerPlatform.Environment | ||
//{ | ||
// public class PowerPlatformConnectorContact | ||
// { | ||
// } | ||
//} |
25 changes: 25 additions & 0 deletions
25
src/Commands/Model/PowerPlatform/Environment/Connector/PowerPlatformConnectorCreatedBy.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
using System.Text.Json.Serialization; | ||
|
||
namespace PnP.PowerShell.Commands.Model.PowerPlatform.Environment | ||
{ | ||
public class PowerPlatformConnectorCreatedBy | ||
{ | ||
[JsonPropertyName("id")] | ||
public string id { get; set; } | ||
|
||
[JsonPropertyName("displayName")] | ||
public string displayName { get; set; } | ||
|
||
[JsonPropertyName("email")] | ||
public string email { get; set; } | ||
|
||
[JsonPropertyName("type")] | ||
public string type { get; set; } | ||
|
||
[JsonPropertyName("tenantId")] | ||
public string tenantId { get; set; } | ||
|
||
[JsonPropertyName("userPrincipalName")] | ||
public string userPrincipalName { get; set; } | ||
} | ||
} |
28 changes: 28 additions & 0 deletions
28
...mands/Model/PowerPlatform/Environment/Connector/PowerPlatformConnectorCustomParameters.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
using System.Text.Json.Serialization; | ||
|
||
namespace PnP.PowerShell.Commands.Model.PowerPlatform.Environment | ||
{ | ||
public class PowerPlatformConnectorCustomParameters | ||
{ | ||
[JsonPropertyName("loginUri")] | ||
public PowerPlatformConnectorLoginUri loginUri { get; set; } | ||
|
||
[JsonPropertyName("tenantId")] | ||
public PowerPlatformConnectorTenantId tenantId { get; set; } | ||
|
||
[JsonPropertyName("resourceUri")] | ||
public PowerPlatformConnectorResourceUri resourceUri { get; set; } | ||
|
||
[JsonPropertyName("authorizationUrl")] | ||
public PowerPlatformConnectorAuthorizationUrl authorizationUrl { get; set; } | ||
|
||
[JsonPropertyName("tokenUrl")] | ||
public PowerPlatformConnectorTokenUrl tokenUrl { get; set; } | ||
|
||
[JsonPropertyName("refreshUrl")] | ||
public PowerPlatformConnectorRefreshUrl refreshUrl { get; set; } | ||
|
||
[JsonPropertyName("enableOnbehalfOfLogin")] | ||
public PowerPlatformConnectorEnableOnbehalfOfLogin enableOnbehalfOfLogin { get; set; } | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
.../Model/PowerPlatform/Environment/Connector/PowerPlatformConnectorEnableOnbehalfOfLogin.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
using System.Text.Json.Serialization; | ||
|
||
namespace PnP.PowerShell.Commands.Model.PowerPlatform.Environment | ||
{ | ||
public class PowerPlatformConnectorEnableOnbehalfOfLogin | ||
{ | ||
[JsonPropertyName("value")] | ||
public string value { get; set; } | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
src/Commands/Model/PowerPlatform/Environment/Connector/PowerPlatformConnectorEnvironment.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
using System.Text.Json.Serialization; | ||
|
||
namespace PnP.PowerShell.Commands.Model.PowerPlatform.Environment | ||
{ | ||
public class PowerPlatformConnectorEnvironment | ||
{ | ||
[JsonPropertyName("id")] | ||
public string id { get; set; } | ||
|
||
[JsonPropertyName("name")] | ||
public string name { get; set; } | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
src/Commands/Model/PowerPlatform/Environment/Connector/PowerPlatformConnectorLicense.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
//namespace PnP.PowerShell.Commands.Model.PowerPlatform.Environment | ||
//{ | ||
// public class PowerPlatformConnectorLicense | ||
// { | ||
// } | ||
//} |
10 changes: 10 additions & 0 deletions
10
src/Commands/Model/PowerPlatform/Environment/Connector/PowerPlatformConnectorLoginUri.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
using System.Text.Json.Serialization; | ||
|
||
namespace PnP.PowerShell.Commands.Model.PowerPlatform.Environment | ||
{ | ||
public class PowerPlatformConnectorLoginUri | ||
{ | ||
[JsonPropertyName("value")] | ||
public string value { get; set; } | ||
} | ||
} |
Oops, something went wrong.