Skip to content

Commit

Permalink
Merge pull request #2499 from koskila/antti/fix-RestoreRecycleBinItem…
Browse files Browse the repository at this point in the history
…Parameters

Super basic simple fix: now accepts -RowLimit parameter
  • Loading branch information
gautamdsheth authored Oct 27, 2022
2 parents dc14ea3 + ea7c52b commit f9ffce0
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
9 changes: 9 additions & 0 deletions src/Commands/Properties/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion src/Commands/Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@
</data>
<data name="NoSharePointConnectionInProvidedConnection" xml:space="preserve">
<value>The provided connection through -Connection holds no SharePoint context. Please use one of the Connect-PnPOnline commands which uses the -Url argument to connect.</value>
</data>
</data>
<data name="NoConnectionToDisconnect" xml:space="preserve">
<value>No connection to disconnect</value>
</data>
Expand Down Expand Up @@ -363,4 +363,7 @@
<data name="RemoveListDesign" xml:space="preserve">
<value>Remove list design?</value>
</data>
<data name="Restore0RecycleBinItems" xml:space="preserve">
<value>Restore {0} items from recycle bin to their original locations?</value>
</data>
</root>
4 changes: 2 additions & 2 deletions src/Commands/RecycleBin/RestoreRecycleBinItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ namespace PnP.PowerShell.Commands.RecycleBin
[OutputType(typeof(void))]
public class RestoreRecycleBinItem : PnPSharePointCmdlet
{
[Parameter(Mandatory = true, ValueFromPipeline = true)]
[Parameter(Mandatory = false, ValueFromPipeline = true)]
public RecycleBinItemPipeBind Identity;

[Parameter(Mandatory = false)]
Expand All @@ -37,7 +37,7 @@ protected override void ExecuteCmdlet()
{
if (ParameterSpecified(nameof(RowLimit)))
{
if (Force || ShouldContinue(Resources.RestoreRecycleBinItems, Resources.Confirm))
if (Force || ShouldContinue(string.Format(Resources.Restore0RecycleBinItems, RowLimit), Resources.Confirm))
{
RecycleBinItemCollection items = ClientContext.Site.GetRecycleBinItems(null, RowLimit, false, RecycleBinOrderBy.DeletedDate, RecycleBinItemState.None);
ClientContext.Load(items);
Expand Down

0 comments on commit f9ffce0

Please sign in to comment.