diff --git a/src/Commands/PowerPlatform/Environment/GetPowerPlatformConnectors.cs b/src/Commands/PowerPlatform/Environment/GetPowerPlatformConnectors.cs deleted file mode 100644 index 81ab4da87..000000000 --- a/src/Commands/PowerPlatform/Environment/GetPowerPlatformConnectors.cs +++ /dev/null @@ -1,65 +0,0 @@ -using PnP.PowerShell.Commands.Attributes; -using PnP.PowerShell.Commands.Base; -using PnP.PowerShell.Commands.Utilities.REST; -using System; -using System.Management.Automation; -using System.Linq; -using PnP.PowerShell.Commands.Base.PipeBinds; -using System.Security.Cryptography.X509Certificates; - -namespace PnP.PowerShell.Commands.PowerPlatform.Environment -{ - [Cmdlet(VerbsCommon.Get, "PnPPowerPlatformConnectors")] - public class GetPowerPlatformConnectors : PnPAzureManagementApiCmdlet - { - - [Parameter(Mandatory = false, ValueFromPipeline = true)] - public PowerPlatformEnvironmentPipeBind Environment; - - [Parameter(Mandatory = false)] - public SwitchParameter AsAdmin; - - [Parameter(Mandatory = false)] - public PowerPlatformConnectorPipeBind Identity; - - protected override void ExecuteCmdlet() - { - string environmentName = null; - if (ParameterSpecified(nameof(Environment))) - { - environmentName = Environment.GetName(); - WriteVerbose($"Using environment as provided '{environmentName}'"); - } - else - { - var environments = GraphHelper.GetResultCollectionAsync(Connection, "https://management.azure.com/providers/Microsoft.ProcessSimple/environments?api-version=2016-11-01", AccessToken).GetAwaiter().GetResult(); - environmentName = environments.FirstOrDefault(e => e.Properties.IsDefault.HasValue && e.Properties.IsDefault == true)?.Name; - - if (string.IsNullOrEmpty(environmentName)) - { - throw new Exception($"No default environment found, please pass in a specific environment name using the {nameof(Environment)} parameter"); - } - - WriteVerbose($"Using default environment as retrieved '{environmentName}'"); - } - - if (ParameterSpecified(nameof(Identity))) - { - var appName = Identity.GetName(); - - WriteVerbose($"Retrieving specific Custom Connector with the provided name '{appName}' within the environment '{environmentName}'"); - - var result = GraphHelper.GetAsync(Connection, $"https://api.powerapps.com/providers/Microsoft.PowerApps{(AsAdmin ? "/scopes/admin/environments/" + environmentName : "")}/apis/{appName}?api-version=2016-11-01&$filter=environment eq '{environmentName}' and isCustomApi eq 'True'", AccessToken).GetAwaiter().GetResult(); - WriteObject(result, false); - } - else - { - WriteVerbose($"Retrieving all Connectors within environment '{environmentName}'"); - - var connectors = GraphHelper.GetResultCollectionAsync(Connection, $"https://api.powerapps.com/providers/Microsoft.PowerApps/apis?api-version=2016-11-01&$filter=environment eq '{environmentName}' and isCustomApi eq 'True'", AccessToken).GetAwaiter().GetResult(); - WriteObject(connectors, true); - } - - } - } -} \ No newline at end of file diff --git a/src/Commands/PowerPlatform/Environment/GetPowerPlatformSolution.cs b/src/Commands/PowerPlatform/Environment/GetPowerPlatformSolution.cs index 64efe3a0a..8a7d458eb 100644 --- a/src/Commands/PowerPlatform/Environment/GetPowerPlatformSolution.cs +++ b/src/Commands/PowerPlatform/Environment/GetPowerPlatformSolution.cs @@ -56,7 +56,6 @@ protected override void ExecuteCmdlet() { WriteVerbose($"Retrieving all Solutions within environment '{environmentName}'"); var requestUrl = dynamicsScopeUrl + "/api/data/v9.0/solutions?$filter=isvisible eq true&$expand=publisherid($select=friendlyname)&api-version=9.1"; - //https://orge92ba4cd.crm8.dynamics.com/api/data/v9.0/solutions?%24expand=publisherid&%24filter=(isvisible%20eq%20true)&%24orderby=createdon%20desc var solutions = GraphHelper.GetResultCollectionAsync(Connection, requestUrl, accessTokenForGettingSolutions).GetAwaiter().GetResult(); WriteObject(solutions, true); }