Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New graph helper #4617

Merged
merged 38 commits into from
Dec 15, 2024
Merged
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
df05c19
Update use of GraphHelper
erwinvanhunen Nov 30, 2024
72506a3
Merge branch 'dev' into NewGraphHelper
erwinvanhunen Nov 30, 2024
ce30688
Renamed GraphHelper to ApiRequestHelper
erwinvanhunen Nov 30, 2024
490d544
Simplified examples
erwinvanhunen Dec 1, 2024
ada8aea
simplified URL
erwinvanhunen Dec 1, 2024
0d38771
renamed file and updated url handling
erwinvanhunen Dec 1, 2024
95ef60e
Nightly publish to PowerShell Gallery
erwinvanhunen Dec 1, 2024
54f55d1
Update to version checker
erwinvanhunen Dec 1, 2024
690dcd2
Rewrote to use tracelog and added Format-PnPTraceLog cmdlet
erwinvanhunen Dec 1, 2024
b564caa
Added automatic login: more work to do
erwinvanhunen Dec 2, 2024
a84f5b2
switched to settings.json
erwinvanhunen Dec 4, 2024
71a26ae
Nightly publish to PowerShell Gallery
erwinvanhunen Dec 2, 2024
9be6e15
Add ExtendPermissionsToUnprotectedFiles parameter to Set-PnPTenant cm…
gautamdsheth Dec 2, 2024
c343145
Nightly publish to PowerShell Gallery
erwinvanhunen Dec 3, 2024
08fc070
Added deprecation notice on the SharePoint Mail API
KoenZomers Dec 3, 2024
fe71fc6
Nightly publish to PowerShell Gallery
erwinvanhunen Dec 4, 2024
e79271e
Added paramset for working with doclibs
KoenZomers Dec 3, 2024
d6f4026
Finalized implementation of Get-PnPFolderItem
KoenZomers Dec 3, 2024
cebed4f
Added same logic to Get-PnPFileInFolder and Get-PnPFolderInFolder as …
KoenZomers Dec 3, 2024
38c32b4
Added changelog entry
KoenZomers Dec 3, 2024
814968f
moved from cachesettings.json to settings.json
erwinvanhunen Dec 4, 2024
22caf50
Updated handling of tracelog
erwinvanhunen Dec 4, 2024
c546ec3
refactored private field name
erwinvanhunen Dec 4, 2024
1c7a97e
Updated tracelogging
erwinvanhunen Dec 4, 2024
caf59bd
renamed file
erwinvanhunen Dec 4, 2024
25bdc3c
Updated tracelogging cmdlets
erwinvanhunen Dec 4, 2024
b2ece1e
Nightly publish to PowerShell Gallery
erwinvanhunen Dec 5, 2024
fec973c
Merge branch 'dev' into NewGraphHelper
erwinvanhunen Dec 5, 2024
1c3f0f6
removed unneeded include
erwinvanhunen Dec 5, 2024
0f1f542
Removed unused usings
erwinvanhunen Dec 5, 2024
f484329
Fixed using
erwinvanhunen Dec 5, 2024
d77554e
Changed warning message
erwinvanhunen Dec 5, 2024
49b1166
Updated cleaning
erwinvanhunen Dec 5, 2024
8ce27d5
Merge branch 'dev' into NewGraphHelper
erwinvanhunen Dec 9, 2024
986269c
Updated cache enabled message
erwinvanhunen Dec 9, 2024
a686e91
Fixed JSON escaping in log message
erwinvanhunen Dec 9, 2024
3e19244
Merge branch 'dev' into NewGraphHelper
gautamdsheth Dec 15, 2024
006dea3
Merge branch 'dev' into NewGraphHelper
gautamdsheth Dec 15, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
16 changes: 8 additions & 8 deletions documentation/Invoke-PnPGraphMethod.md
Original file line number Diff line number Diff line change
@@ -96,48 +96,48 @@ Set the new displayName of the group with a Patch request.

### Example 4
```powershell
Invoke-PnPGraphMethod -Url "v1.0/users?$filter=accountEnabled ne true&$count=true" -Method Get -ConsistencyLevelEventual
Invoke-PnPGraphMethod -Url "users?`$filter=accountEnabled ne true&`$count=true" -Method Get -ConsistencyLevelEventual
```

Get users with advanced query capabilities. Use of -ConsistencyLevelEventual.

### Example 5
```powershell
Invoke-PnPGraphMethod -Url "https://graph.microsoft.com/v1.0/users"
Invoke-PnPGraphMethod -Url "users"
```

Performs a GET request to retrieve users from the Microsoft Graph API using the full URL.

### Example 6
```powershell
Invoke-PnPGraphMethod -Url "https://graph.microsoft.com/v1.0/users/user@contoso.com/photo/`$value" -OutFile c:\temp\photo.jpg
Invoke-PnPGraphMethod -Url "users/user@contoso.com/photo/`$value" -OutFile c:\temp\photo.jpg
```

Downloads the user profile photo of the specified user to the specified file.

### Example 7
```powershell
Invoke-PnPGraphMethod -Url "https://graph.microsoft.com/v1.0/users/user@contoso.com/photo/`$value" -OutStream | Add-PnPFile -FileName user.jpg -Folder "Shared Documents"
Invoke-PnPGraphMethod -Url "users/user@contoso.com/photo/`$value" -OutStream | Add-PnPFile -FileName user.jpg -Folder "Shared Documents"
```

Takes the user profile photo of the specified user and uploads it to the specified library in SharePoint Online.

### Example 8
```powershell
$task = Invoke-PnPGraphMethod -Url "https://graph.microsoft.com/v1.0/planner/tasks/23fasefxcvzvsdf32e" # retrieve the task so we can figure out the etag which is needed to update the task
$task = Invoke-PnPGraphMethod -Url "planner/tasks/23fasefxcvzvsdf32e" # retrieve the task so we can figure out the etag which is needed to update the task
$etag = $task.'@odata.etag'
$headers = @{"If-Match"=$etag}
$content = @{"title"="My new task title"}
Invoke-PnPGraphMethod -Url "https://graph.microsoft.com/v1.0/planner/tasks/23fasefxcvzvsdf32e" -Method PATCH -Content $content -AdditionalHeaders $headers
Invoke-PnPGraphMethod -Url "planner/tasks/23fasefxcvzvsdf32e" -Method PATCH -Content $content -AdditionalHeaders $headers
```

This example retrieves a Planner task to find the etag value which is required to update the task. In order to update the task through call to the Microsoft Graph API we need to include an If-Match header with the value of the etag. It then creates the content to update, in this case the title of the task, and calls the PATCH method on the Graph end-point to update the specific task.

### EXAMPLE 9
```powershell
$batch = New-PnPBatch -RetainRequests
Invoke-PnPSPRestMethod -Method Get -Url "https://graph.microsoft.com/v1.0/users" -Batch $batch
Invoke-PnPSPRestMethod -Method Get -Url "https://graph.microsoft.com/v1.0/groups" -Batch $batch
Invoke-PnPSPRestMethod -Method Get -Url "users" -Batch $batch
Invoke-PnPSPRestMethod -Method Get -Url "groups" -Batch $batch
$response = Invoke-PnPBatch $batch -Details
$response
```
3 changes: 0 additions & 3 deletions src/Commands/Admin/AddHomeSite.cs
Original file line number Diff line number Diff line change
@@ -2,9 +2,6 @@
using Microsoft.SharePoint.Client;
using PnP.PowerShell.Commands.Base;
using System.Management.Automation;
using PnP.PowerShell.Commands.Base.PipeBinds;
using PnP.Core.Model;
using System;

namespace PnP.PowerShell.Commands.Admin
{
2 changes: 0 additions & 2 deletions src/Commands/Admin/AddHubToHubAssociation.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
using Microsoft.Online.SharePoint.TenantAdministration;
using Microsoft.SharePoint.Client;

using PnP.PowerShell.Commands.Base;
using System.Management.Automation;
using PnP.PowerShell.Commands.Base.PipeBinds;
using System;

namespace PnP.PowerShell.Commands.Admin
1 change: 0 additions & 1 deletion src/Commands/Admin/AddOrgAssetsLibrary.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using Microsoft.SharePoint.Client;

using PnP.PowerShell.Commands.Base;
using System.Management.Automation;
using Microsoft.Online.SharePoint.TenantAdministration;
1 change: 0 additions & 1 deletion src/Commands/Admin/GetContainer.cs
Original file line number Diff line number Diff line change
@@ -3,7 +3,6 @@
using Microsoft.SharePoint.Client;
using PnP.PowerShell.Commands.Base;
using PnP.PowerShell.Commands.Base.PipeBinds;
using PnP.PowerShell.Commands.Model.SharePoint;
using System;
using System.Collections.Generic;
using System.Management.Automation;
3 changes: 0 additions & 3 deletions src/Commands/Admin/GetContainerType.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
using Microsoft.Online.SharePoint.TenantAdministration;
using Microsoft.SharePoint.Client;
using PnP.PowerShell.Commands.Base;
using PnP.PowerShell.Commands.Base.PipeBinds;
using PnP.PowerShell.Commands.Utilities;
using System;
using System.Collections.Generic;
using System.Management.Automation;

3 changes: 0 additions & 3 deletions src/Commands/Admin/GetDeletedContainer.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
using Microsoft.Online.SharePoint.TenantAdministration;
using Microsoft.SharePoint.Client;
using PnP.PowerShell.Commands.Base;
using PnP.PowerShell.Commands.Base.PipeBinds;
using PnP.PowerShell.Commands.Utilities;
using System;
using System.Collections.Generic;
using System.Management.Automation;

1 change: 0 additions & 1 deletion src/Commands/Admin/GetHubSite.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using Microsoft.SharePoint.Client;

using PnP.PowerShell.Commands.Base;
using PnP.PowerShell.Commands.Base.PipeBinds;
using System.Management.Automation;
3 changes: 1 addition & 2 deletions src/Commands/Admin/GetStorageEntity.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System.Linq;
using System.Management.Automation;
using System.Management.Automation;
using Microsoft.SharePoint.Client;
using PnP.PowerShell.Commands.Enums;
using System.Collections.Generic;
1 change: 0 additions & 1 deletion src/Commands/Admin/GetTenant.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using Microsoft.SharePoint.Client;

using PnP.PowerShell.Commands.Base;
using System.Management.Automation;
using PnP.PowerShell.Commands.Model;
4 changes: 2 additions & 2 deletions src/Commands/Admin/GetTenantDeletedSite.cs
Original file line number Diff line number Diff line change
@@ -59,7 +59,7 @@ protected override void ExecuteCmdlet()
}
foreach (DeletedSiteProperties item in list)
{
WriteObject(new Model.SPODeletedSite(item, Detailed.ToBool(), AdminContext, this));
WriteObject(new Model.SPODeletedSite(item, Detailed.ToBool(), AdminContext));
}
if (!flag2 && flag3)
{
@@ -74,7 +74,7 @@ protected override void ExecuteCmdlet()
try
{
AdminContext.ExecuteQueryRetry();
WriteObject(new Model.SPODeletedSite(deletedSitePropertiesByUrl, Detailed.ToBool(), AdminContext, this));
WriteObject(new Model.SPODeletedSite(deletedSitePropertiesByUrl, Detailed.ToBool(), AdminContext));
}
catch (ServerException e) when (e.ServerErrorTypeName.Equals("Microsoft.SharePoint.Client.UnknownError", StringComparison.InvariantCultureIgnoreCase))
{
5 changes: 2 additions & 3 deletions src/Commands/Admin/GetTenantInfo.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using Microsoft.SharePoint.Client;
using PnP.PowerShell.Commands.Attributes;
using PnP.PowerShell.Commands.Base;
using PnP.PowerShell.Commands.Utilities.REST;
using System;
using System.Management.Automation;

@@ -33,11 +32,11 @@ protected override void ExecuteCmdlet()
}

WriteVerbose("Acquiring access token for Microsoft Graph to look up Tenant");
var graphAccessToken = TokenHandler.GetAccessToken(this, $"https://{Connection.GraphEndPoint}/.default", Connection);
//var graphAccessToken = TokenHandler.GetAccessToken(this, $"https://{Connection.GraphEndPoint}/.default", Connection);
var requestUrl = BuildRequestUrl();

WriteVerbose($"Making call to {requestUrl} to request tenant information");
var results = GraphHelper.Get<Model.TenantInfo>(this, Connection, requestUrl, graphAccessToken);
var results = this.RequestHelper.Get<Model.TenantInfo>(requestUrl);
WriteObject(results, true);
}

1 change: 0 additions & 1 deletion src/Commands/Admin/GetTenantInternalSetting.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using Microsoft.SharePoint.Client;

using PnP.PowerShell.Commands.Base;
using System.Management.Automation;
using PnP.PowerShell.Commands.Model;
2 changes: 0 additions & 2 deletions src/Commands/Admin/GrantHubSiteRights.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
using Microsoft.Online.SharePoint.TenantAdministration;
using Microsoft.SharePoint.Client;

using PnP.PowerShell.Commands.Base;
using PnP.PowerShell.Commands.Base.PipeBinds;
using System;
using System.Management.Automation;

namespace PnP.PowerShell.Commands.Admin
3 changes: 0 additions & 3 deletions src/Commands/Admin/NewTenantSite.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
using Microsoft.Online.SharePoint.TenantManagement;
using Microsoft.SharePoint.Client;
using PnP.Framework;
using PnP.Framework.Entities;

using PnP.PowerShell.Commands.Base;
using System;
using System.Management.Automation;
using Resources = PnP.PowerShell.Commands.Properties.Resources;

namespace PnP.PowerShell.Commands
{
1 change: 0 additions & 1 deletion src/Commands/Admin/RegisterAppCatalogSite.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using Microsoft.SharePoint.Client;

using PnP.PowerShell.Commands.Base;
using System.Management.Automation;

2 changes: 0 additions & 2 deletions src/Commands/Admin/RegisterHubSite.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
using Microsoft.Online.SharePoint.TenantAdministration;
using Microsoft.SharePoint.Client;

using PnP.PowerShell.Commands.Base;
using System.Management.Automation;
using PnP.Framework.Sites;
using PnP.PowerShell.Commands.Base.PipeBinds;
using System;

1 change: 0 additions & 1 deletion src/Commands/Admin/RemoveContainerType.cs
Original file line number Diff line number Diff line change
@@ -2,7 +2,6 @@
using Microsoft.SharePoint.Client;
using PnP.PowerShell.Commands.Base;
using System.Management.Automation;
using PnP.PowerShell.Commands.Base.PipeBinds;
using System;

namespace PnP.PowerShell.Commands.Admin
1 change: 0 additions & 1 deletion src/Commands/Admin/RemoveKnowledgeHubSite.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using Microsoft.SharePoint.Client;

using PnP.PowerShell.Commands.Base;
using System.Management.Automation;

1 change: 0 additions & 1 deletion src/Commands/Admin/RemoveStorageEntity.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using System.Management.Automation;
using Microsoft.SharePoint.Client;

using PnP.PowerShell.Commands.Enums;

namespace PnP.PowerShell.Commands
1 change: 0 additions & 1 deletion src/Commands/Admin/RenameTenantSite.cs
Original file line number Diff line number Diff line change
@@ -3,7 +3,6 @@
using PnP.PowerShell.Commands.Base;
using PnP.PowerShell.Commands.Base.PipeBinds;
using PnP.PowerShell.Commands.Model;
using PnP.PowerShell.Commands.Utilities;
using System;
using System.Collections.Generic;
using System.Management.Automation;
2 changes: 0 additions & 2 deletions src/Commands/Admin/RestoreDeletedContainer.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
using Microsoft.Online.SharePoint.TenantAdministration;
using Microsoft.SharePoint.Client;
using PnP.PowerShell.Commands.Base;
using PnP.PowerShell.Commands.Base.PipeBinds;
using System;
using System.Management.Automation;

namespace PnP.PowerShell.Commands.Admin
1 change: 0 additions & 1 deletion src/Commands/Admin/SetBuiltInDesignPackageVisibility.cs
Original file line number Diff line number Diff line change
@@ -2,7 +2,6 @@
using System.Management.Automation;
using Microsoft.SharePoint.Client;
using Microsoft.SharePoint.Administration;
using System;

namespace PnP.PowerShell.Commands.Admin
{
1 change: 0 additions & 1 deletion src/Commands/Admin/SetDisableSpacesActivation.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using System.Management.Automation;
using Microsoft.SharePoint.Client;

using PnP.PowerShell.Commands.Base;
using Microsoft.Online.SharePoint.TenantAdministration;
using PnP.PowerShell.Commands.Base.PipeBinds;
1 change: 0 additions & 1 deletion src/Commands/Admin/SetHideDefaultThemes.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using Microsoft.Online.SharePoint.TenantAdministration;
using Microsoft.SharePoint.Client;

using PnP.PowerShell.Commands.Base;
using System.Management.Automation;

1 change: 0 additions & 1 deletion src/Commands/Admin/SetOrgAssetsLibrary.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using Microsoft.SharePoint.Client;

using PnP.PowerShell.Commands.Base;
using System.Management.Automation;
using Microsoft.Online.SharePoint.TenantAdministration;
1 change: 0 additions & 1 deletion src/Commands/Admin/SetStorageEntity.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using System.Management.Automation;
using Microsoft.SharePoint.Client;

using PnP.PowerShell.Commands.Enums;

namespace PnP.PowerShell.Commands
2 changes: 0 additions & 2 deletions src/Commands/Apps/AddApplicationCustomizer.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
using System.Management.Automation;
using Microsoft.SharePoint.Client;
using PnP.Framework.Entities;

using PnP.PowerShell.Commands.Enums;
using PnP.PowerShell.Commands.Base.PipeBinds;
using System;

namespace PnP.PowerShell.Commands.Branding
6 changes: 3 additions & 3 deletions src/Commands/Apps/AddAzureADServicePrincipalAppRole.cs
Original file line number Diff line number Diff line change
@@ -36,7 +36,7 @@ public class AddAzureADServicePrincipalAppRole : PnPGraphCmdlet

protected override void ExecuteCmdlet()
{
var principal = Principal.GetServicePrincipal(this, Connection, AccessToken);
var principal = Principal.GetServicePrincipal(RequestHelper);

if (principal == null)
{
@@ -49,7 +49,7 @@ protected override void ExecuteCmdlet()

if (AppRole.AppRole == null)
{
var resource = ParameterSetName == ParameterSet_BYBUILTINTYPE ? ServicePrincipalUtility.GetServicePrincipalByBuiltInType(this, Connection, AccessToken, BuiltInType) : Resource.GetServicePrincipal(this, Connection, AccessToken);
var resource = ParameterSetName == ParameterSet_BYBUILTINTYPE ? ServicePrincipalUtility.GetServicePrincipalByBuiltInType(RequestHelper, BuiltInType) : Resource.GetServicePrincipal(RequestHelper);

if (resource == null)
{
@@ -69,7 +69,7 @@ protected override void ExecuteCmdlet()

WriteVerbose($"Adding app role {appRole.Value}: {appRole.DisplayName}");

var response = ServicePrincipalUtility.AddServicePrincipalRoleAssignment(this, Connection, AccessToken, principal, appRole);
var response = ServicePrincipalUtility.AddServicePrincipalRoleAssignment(RequestHelper, principal, appRole);
WriteObject(response, false);
}
}
7 changes: 1 addition & 6 deletions src/Commands/Apps/GetApp.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
using System.Collections.Generic;
using System.Linq;
using System.Management.Automation;

using System.Management.Automation;
using PnP.PowerShell.Commands.Base.PipeBinds;
using PnP.Framework.ALM;
using System;
using PnP.PowerShell.Commands.Enums;
using PnP.Framework.Enums;
using Microsoft.SharePoint.Client;

namespace PnP.PowerShell.Commands.Apps
{
7 changes: 3 additions & 4 deletions src/Commands/Apps/GetAzureADAppSitePermission.cs
Original file line number Diff line number Diff line change
@@ -6,7 +6,6 @@
using PnP.PowerShell.Commands.Base;
using PnP.PowerShell.Commands.Base.PipeBinds;
using PnP.PowerShell.Commands.Model;
using PnP.PowerShell.Commands.Utilities.REST;

namespace PnP.PowerShell.Commands.Apps
{
@@ -52,14 +51,14 @@ protected override void ExecuteCmdlet()
var accessToken = AccessToken;

// All permissions, first fetch just the Ids as the API works in a weird way that requesting all permissions does not reveal their roles, so we will request all permissions and then request each permission individually so we will also have the roles
var permissions = GraphHelper.GetResultCollection<AzureADAppPermissionInternal>(this, Connection, $"https://{Connection.GraphEndPoint}/v1.0/sites/{siteId}/permissions?$select=Id", accessToken);
var permissions = this.RequestHelper.GetResultCollection<AzureADAppPermissionInternal>($"v1.0/sites/{siteId}/permissions?$select=Id");
if (permissions.Any())
{
var results = new List<AzureADAppPermission>();
foreach (var permission in permissions)
{
// Request the permission individually so it will include the roles
var detailedApp = GraphHelper.Get<AzureADAppPermissionInternal>(this, Connection, $"https://{Connection.GraphEndPoint}/v1.0/sites/{siteId}/permissions/{permission.Id}", accessToken);
var detailedApp = this.RequestHelper.Get<AzureADAppPermissionInternal>($"v1.0/sites/{siteId}/permissions/{permission.Id}");
results.Add(detailedApp.Convert());
}

@@ -76,7 +75,7 @@ protected override void ExecuteCmdlet()
}
else
{
var results = GraphHelper.Get<AzureADAppPermissionInternal>(this, Connection, $"https://{Connection.GraphEndPoint}/v1.0/sites/{siteId}/permissions/{PermissionId}", AccessToken);
var results = RequestHelper.Get<AzureADAppPermissionInternal>($"v1.0/sites/{siteId}/permissions/{PermissionId}");
WriteObject(results.Convert());
}
}
10 changes: 5 additions & 5 deletions src/Commands/Apps/GetAzureADServicePrincipal.cs
Original file line number Diff line number Diff line change
@@ -43,19 +43,19 @@ protected override void ExecuteCmdlet()
switch (ParameterSetName)
{
case ParameterSet_BYAPPID:
servicePrincipal = ServicePrincipalUtility.GetServicePrincipalByAppId(this, Connection, AccessToken, AppId);
servicePrincipal = ServicePrincipalUtility.GetServicePrincipalByAppId(RequestHelper, AppId);
break;
case ParameterSet_BYOBJECTID:
servicePrincipal = ServicePrincipalUtility.GetServicePrincipalByObjectId(this, Connection, AccessToken, ObjectId);
servicePrincipal = ServicePrincipalUtility.GetServicePrincipalByObjectId(RequestHelper, ObjectId);
break;
case ParameterSet_BYAPPNAME:
servicePrincipal = ServicePrincipalUtility.GetServicePrincipalByAppName(this, Connection, AccessToken, AppName);
servicePrincipal = ServicePrincipalUtility.GetServicePrincipalByAppName(RequestHelper, AppName);
break;
case ParameterSet_BYBUILTINTYPE:
servicePrincipal = ServicePrincipalUtility.GetServicePrincipalByBuiltInType(this, Connection, AccessToken, BuiltInType);
servicePrincipal = ServicePrincipalUtility.GetServicePrincipalByBuiltInType(RequestHelper, BuiltInType);
break;
case ParameterSet_ALL:
var servicePrincipals = ServicePrincipalUtility.GetServicePrincipals(this, Connection, AccessToken, Filter);
var servicePrincipals = ServicePrincipalUtility.GetServicePrincipals(RequestHelper, Filter);
WriteObject(servicePrincipals, true);
return;
}
Loading
Loading