-
Notifications
You must be signed in to change notification settings - Fork 359
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Get-LargelistOperationStatus (#3033)
* Add Get-LargeListRemovalStatus cmd * Command working * Add documentation and rename LargelistOperationStatus * Rename LargeListRemovalStatus * Rename to Get-PnPLargeListOperationStatus * Update documentatuib --------- Co-authored-by: Gautam Sheth <[email protected]>
- Loading branch information
1 parent
07ae699
commit 23fb088
Showing
5 changed files
with
122 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
--- | ||
Module Name: PnP.PowerShell | ||
title: Get-PnPLargeListOperationStatus | ||
schema: 2.0.0 | ||
applicable: SharePoint Online | ||
external help file: PnP.PowerShell.dll-Help.xml | ||
online version: https://pnp.github.io/powershell/cmdlets/Get-PnPLargeListOperationStatus.html | ||
--- | ||
|
||
# Get-PnPLargeListOperationStatus | ||
|
||
## SYNOPSIS | ||
Get the status of a large list operation. Currently supports Large List Removal Operation. | ||
|
||
## SYNTAX | ||
|
||
```powershell | ||
Get-PnPLargeListOperationStatus [-ListId] <ListId> [-OperationId] <OperationId> [-Connection <PnPConnection>] | ||
``` | ||
|
||
## DESCRIPTION | ||
|
||
Allows to get the status of a large list operation. | ||
|
||
## EXAMPLES | ||
|
||
### EXAMPLE 1 | ||
```powershell | ||
Get-PnPLargeListOperationStatus -ListId 9ea5d197-2227-4156-9ae1-725d74dc029d -OperationId 924e6a34-5c90-4d0d-8083-2efc6d1cf481 | ||
``` | ||
|
||
## PARAMETERS | ||
|
||
### -ListId | ||
ListId/Guid of the list. Retrieve the value for this parameter from the output of the Large List Operation Command. | ||
|
||
```yaml | ||
Type: Guid | ||
Parameter Sets: (All) | ||
|
||
Required: True | ||
Position: Named | ||
Default value: None | ||
Accept pipeline input: True (ByValue) | ||
Accept wildcard characters: False | ||
``` | ||
### -OperationId | ||
OperationId/Guid of the Large List Operation. Retrieve the value for this parameter from the output of the Large List Operation Command. | ||
```yaml | ||
Type: Guid | ||
Parameter Sets: (All) | ||
|
||
Required: True | ||
Position: Named | ||
Default value: None | ||
Accept pipeline input: True (ByValue) | ||
Accept wildcard characters: False | ||
``` | ||
### -Connection | ||
Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. | ||
```yaml | ||
Type: PnPConnection | ||
Parameter Sets: (All) | ||
|
||
Required: False | ||
Position: Named | ||
Default value: None | ||
Accept pipeline input: False | ||
Accept wildcard characters: False | ||
``` | ||
## RELATED LINKS | ||
[Microsoft 365 Patterns and Practices](https://aka.ms/m365pnp) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
using System; | ||
using System.Management.Automation; | ||
|
||
using Microsoft.SharePoint.Client; | ||
|
||
using PnP.PowerShell.Commands.Base.PipeBinds; | ||
using PnP.PowerShell.Commands.Model.SharePoint; | ||
|
||
namespace PnP.PowerShell.Commands.Lists | ||
{ | ||
[Cmdlet(VerbsCommon.Get, "PnPLargeListOperationStatus")] | ||
public class GetLargeListOperationStatus : PnPWebCmdlet | ||
{ | ||
[Parameter(Mandatory = true)] | ||
public Guid ListId; | ||
|
||
[Parameter(Mandatory = true)] | ||
public Guid OperationId; | ||
|
||
protected override void ExecuteCmdlet() | ||
{ | ||
var operation = ClientContext.Web.GetListOperation(ListId, OperationId); | ||
ClientContext.Load(operation); | ||
ClientContext.ExecuteQueryRetry(); | ||
WriteObject(new RecycleBinLargeOperationResult { RecycleBinLargeOperationType = operation.OperationType, RecycleBinLargeOperationResourceLocation = operation.ResourceLocation, RecycleBinLargeOperationStatus = operation.Status, RecycleBinLargeOperationProgressPercentage = operation.ProgressPercentage}); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters