Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cmdlet remove-pnpcontainertype and minor changes. closes #3670. #3689

Merged
merged 6 commits into from
Jan 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion documentation/Remove-PnPContainer.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ Specify container site url or container id.
Type: ContainerPipeBind
Parameter Sets: (All)

Required: Falsegit
Required: true
Position: 0
Default value: None
Accept pipeline input: True (ByValue)
Expand Down
73 changes: 73 additions & 0 deletions documentation/Remove-PnPContainerType.md
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)
4 changes: 2 additions & 2 deletions src/Commands/Admin/GetContainer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ namespace PnP.PowerShell.Commands.Admin
public class GetContainer : PnPAdminCmdlet
{
[Parameter(Mandatory = false, Position = 0, ValueFromPipeline = true)]
public Guid OwningApplicationId;
public ContainerPipeBind Identity { get; set; }

[Parameter(Mandatory = false)]
public ContainerPipeBind Identity { get; set; }
public Guid OwningApplicationId;

[Parameter(Mandatory = false)]
public SwitchParameter Paged { get; set; }
Expand Down
1 change: 0 additions & 1 deletion src/Commands/Admin/GetDeletedContainer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ public class PnPDeletedContainer : PnPAdminCmdlet
{
protected override void ExecuteCmdlet()
{

IList<SPDeletedContainerProperties> deletedContainers = Tenant.GetSPODeletedContainers();
AdminContext.ExecuteQueryRetry();
WriteObject(deletedContainers, true);
Expand Down
2 changes: 1 addition & 1 deletion src/Commands/Admin/RemoveContainer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace PnP.PowerShell.Commands.Admin
[Cmdlet(VerbsCommon.Remove, "PnPContainer")]
public class RemoveContainer : PnPAdminCmdlet
{
[Parameter(Mandatory = true)]
[Parameter(Mandatory = true, ValueFromPipeline = true, Position = 0)]
public ContainerPipeBind Identity { get; set; }

protected override void ExecuteCmdlet()
Expand Down
24 changes: 24 additions & 0 deletions src/Commands/Admin/RemoveContainerType.cs
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();
}
}
}
Loading