Skip to content

Commit

Permalink
Merge pull request #2001 from gautamdsheth/feature/better-enumeration…
Browse files Browse the repository at this point in the history
…-obj

Feature: added better piping support for certain cmdlets
  • Loading branch information
KoenZomers committed Jun 23, 2022
2 parents 72b9501 + 3314c56 commit a7fd695
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/Commands/Admin/GetSiteCollectionAppCatalogs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ protected override void ExecuteCmdlet()
ClientContext.Load(allowedSites);
ClientContext.ExecuteQueryRetry();

WriteObject(allowedSites);
WriteObject(allowedSites, true);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ protected override void ExecuteCmdlet()
IsPassed = res.Value.IsPassed,
Value = res.Value
};
WriteObject(result);
WriteObject(result, true);
}
}
}
6 changes: 3 additions & 3 deletions src/Commands/Files/FindFile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,20 +29,20 @@ protected override void ExecuteCmdlet()
var list = List.GetList(CurrentWeb);
if (list == null)
throw new ArgumentException("The specified list was not found");
WriteObject(list.FindFiles(Match));
WriteObject(list.FindFiles(Match), true);
break;
}
case "Folder":
{
var folder = Folder.GetFolder(CurrentWeb, false);
if (folder == null)
throw new ArgumentException("The specified folder was not found");
WriteObject(folder.FindFiles(Match));
WriteObject(folder.FindFiles(Match), true);
break;
}
default:
{
WriteObject(CurrentWeb.FindFiles(Match));
WriteObject(CurrentWeb.FindFiles(Match), true);
break;
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/Commands/Lists/GetListPermissions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public class GetListPermissions : PnPWebCmdlet
protected override void ExecuteCmdlet()
{
var list = Identity.GetListOrThrow(nameof(List), PnPContext);
WriteObject(list.GetRoleDefinitions(PrincipalId).RequestedItems);
WriteObject(list.GetRoleDefinitions(PrincipalId).RequestedItems, true);
}
}
}
2 changes: 1 addition & 1 deletion src/Commands/Search/GetSearchConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ protected override void ExecuteCmdlet()
var aliases = GetAliasesFromPid(doc, mp.Pid);
mp.Aliases = aliases;
}
WriteObject(mps);
WriteObject(mps, true);
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/Commands/Search/GetSearchCrawlLog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ protected override void ExecuteCmdlet()
entries.Add(ConvertToPSObject(dictionary));
}
}
WriteObject(entries.Take(origLimit));
WriteObject(entries.Take(origLimit), true);
}
else
{
Expand All @@ -135,7 +135,7 @@ protected override void ExecuteCmdlet()
entries.Where(e => System.Net.WebUtility.UrlDecode(e.Url.ToString()).ToLower().Contains(":443/person"))
.ToList();
}
WriteObject(entries.Take(origLimit).OrderByDescending(i => i.CrawlTime).ToList());
WriteObject(entries.Take(origLimit).OrderByDescending(i => i.CrawlTime).ToList(), true);
}
}
catch (Exception e)
Expand Down
4 changes: 2 additions & 2 deletions src/Commands/Web/GetIndexedPropertyKeys.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ protected override void ExecuteCmdlet()
if (list != null)
{
var keys = list.GetIndexedPropertyBagKeys();
WriteObject(keys);
WriteObject(keys, true);
}
}
else
{
var keys = CurrentWeb.GetIndexedPropertyBagKeys();
WriteObject(keys);
WriteObject(keys, true);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/Commands/Webhooks/GetWebhookSubscriptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ protected override void ExecuteCmdlet()
if (list != null)
{
// Get all the webhook subscriptions for the specified list
WriteObject(list.GetWebhookSubscriptions());
WriteObject(list.GetWebhookSubscriptions(), true);
}
else
{
Expand Down

0 comments on commit a7fd695

Please sign in to comment.