From 24dc84f2b40cb445d13dd21f2195755ff5d1f5d5 Mon Sep 17 00:00:00 2001 From: Gautam Sheth Date: Sat, 21 May 2022 22:25:14 +0300 Subject: [PATCH 1/2] Fix: Get-PnPOrgAssetsLibrary to return correct data --- CHANGELOG.md | 1 + src/Commands/Admin/GetOrgAssetsLibrary.cs | 9 +++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 08b2e1a69..743daa46e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,6 +25,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). ### Changed - Changed `Sync-PnPSharePointUserProfilesFromAzureActiveDirectory` to map users based on their Ids instead which should resolve some issues around user identities reporting not to exist. You can use the new `-IdType` option to switch it back to `PrincipalName` if needed. [#1752](https://github.com/pnp/powershell/pull/1752) +- Changed `Get-PnPOrgAssetsLibrary` to return a proper value of the organisation assets libraries. ### Fixed diff --git a/src/Commands/Admin/GetOrgAssetsLibrary.cs b/src/Commands/Admin/GetOrgAssetsLibrary.cs index 2b0eedee7..744b7afa6 100644 --- a/src/Commands/Admin/GetOrgAssetsLibrary.cs +++ b/src/Commands/Admin/GetOrgAssetsLibrary.cs @@ -1,6 +1,9 @@ -using Microsoft.SharePoint.Client; +using Microsoft.SharePoint.Administration; +using Microsoft.SharePoint.Client; using PnP.PowerShell.Commands.Base; +using System.Collections.Generic; +using System.Linq; using System.Management.Automation; namespace PnP.PowerShell.Commands.Admin @@ -12,7 +15,9 @@ protected override void ExecuteCmdlet() { var results = Tenant.GetOrgAssets(); ClientContext.ExecuteQueryRetry(); - WriteObject(results.Value, true); + + List orgassetlibs = results.Value?.OrgAssetsLibraries?.ToList(); + WriteObject(orgassetlibs, true); } } } \ No newline at end of file From ef1ae20557996d55bc4e72d69da1f84ea1eb966f Mon Sep 17 00:00:00 2001 From: Gautam Sheth Date: Sat, 21 May 2022 22:26:22 +0300 Subject: [PATCH 2/2] Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 743daa46e..dd8c02844 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,7 +25,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). ### Changed - Changed `Sync-PnPSharePointUserProfilesFromAzureActiveDirectory` to map users based on their Ids instead which should resolve some issues around user identities reporting not to exist. You can use the new `-IdType` option to switch it back to `PrincipalName` if needed. [#1752](https://github.com/pnp/powershell/pull/1752) -- Changed `Get-PnPOrgAssetsLibrary` to return a proper value of the organisation assets libraries. +- Changed `Get-PnPOrgAssetsLibrary` to return a proper value of the organisation assets libraries. [#1889](https://github.com/pnp/powershell/pull/1889) ### Fixed