-
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.
Browse files
Browse the repository at this point in the history
* cmdlets remove-pnpcontainertype and minor changes * cmdlets remove-pnpcontainertype and minor changes --------- Co-authored-by: Gautam Sheth <[email protected]>
- Loading branch information
1 parent
d63d84d
commit f36f7fa
Showing
6 changed files
with
101 additions
and
5 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
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,73 @@ | ||
--- | ||
Module Name: PnP.PowerShell | ||
schema: 2.0.0 | ||
applicable: SharePoint Online | ||
online version: https://pnp.github.io/powershell/cmdlets/Remove-PnPContainerType.html | ||
external help file: PnP.PowerShell.dll-Help.xml | ||
title: Remove-PnPContainerType | ||
--- | ||
|
||
# Remove-PnPContainerType | ||
|
||
## SYNOPSIS | ||
|
||
**Required Permissions** | ||
|
||
* SharePoint: Access to the SharePoint Tenant Administration site | ||
|
||
The Remove-PnPContainerType cmdlet removes a trial container from the SharePoint tenant. The container to remove is specified by the Identity parameter. | ||
|
||
|
||
## SYNTAX | ||
|
||
```powershell | ||
Remove-PnPContainerType [-Identity] <Guid> [-Connection <PnPConnection>] | ||
``` | ||
|
||
## DESCRIPTION | ||
|
||
## EXAMPLES | ||
|
||
### EXAMPLE 1 | ||
|
||
```powershell | ||
Remove-PnPContainerType -Identity 00be1092-0c75-028a-18db-89e57908e7d6 | ||
``` | ||
|
||
Removes the specified trial container by using the container id. | ||
|
||
## PARAMETERS | ||
|
||
### -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 | ||
``` | ||
### -Identity | ||
Specify the container id. | ||
```yaml | ||
Type: Guid | ||
Parameter Sets: (All) | ||
|
||
Required: True | ||
Position: 0 | ||
Default value: None | ||
Accept pipeline input: True (ByValue) | ||
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
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,24 @@ | ||
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 | ||
{ | ||
[Cmdlet(VerbsCommon.Remove, "PnPContainerType")] | ||
public class RemoveContainerType : PnPAdminCmdlet | ||
{ | ||
[Parameter(Mandatory = true, ValueFromPipeline = true, Position = 0)] | ||
public Guid Identity { get; set; } | ||
|
||
protected override void ExecuteCmdlet() | ||
{ | ||
SPDeletedContainerTypeProperties sPDeletedContainerTypeProperties = new SPDeletedContainerTypeProperties(); | ||
sPDeletedContainerTypeProperties.ContainerTypeId = Identity; | ||
Tenant.RemoveSPOContainerType(sPDeletedContainerTypeProperties); | ||
AdminContext.ExecuteQueryRetry(); | ||
} | ||
} | ||
} |