Skip to content

Commit

Permalink
New cmdlet for getcontainerType and minor changes to docs
Browse files Browse the repository at this point in the history
  • Loading branch information
reshmee011 authored and gautamdsheth committed May 23, 2024
1 parent f5de7b4 commit 0d546e7
Show file tree
Hide file tree
Showing 6 changed files with 83 additions and 5 deletions.
2 changes: 1 addition & 1 deletion documentation/Get-PnPContainer.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Returns one or more Containers in a SharePoint repository services application.
## SYNTAX

```powershell
Get-PnPContainer [[-Identity] <ContainerPipeBind>] [-OwningApplicationId [Guid]] [-Paged [switchparameter]] [-PagingToken [string]][-Connection <PnPConnection>]
Get-PnPContainer [-Identity <ContainerPipeBind>] [-OwningApplicationId <Guid>] [-Paged <switchparameter>] [-PagingToken <string>][-Connection <PnPConnection>]
```

## DESCRIPTION
Expand Down
55 changes: 55 additions & 0 deletions documentation/Get-PnPContainerType.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
---
Module Name: PnP.PowerShell
schema: 2.0.0
applicable: SharePoint Online
online version: https://pnp.github.io/powershell/cmdlets/Get-PnPContainerType.html
external help file: PnP.PowerShell.dll-Help.xml
title: Get-PnPContainerType
---

# Get-PnPContainerType

## SYNOPSIS

**Required Permissions**

* SharePoint Embedded Administrator or Global Administrator is required

Returns the list of Container Types created for a SharePoint Embedded Application in the tenant.

## SYNTAX

```powershell
Get-PnPContainerType [-Connection <PnPConnection>]
```

## DESCRIPTION

## EXAMPLES

### EXAMPLE 1
```powershell
Get-PnPContainerType
```

Returns the list of Container Types created for a SharePoint Embedded Application in the tenant.pplication.

### -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
[SharePoint Embedded Container Types](https://learn.microsoft.com/en-us/sharepoint/dev/embedded/concepts/app-concepts/containertypes)
[Microsoft 365 Patterns and Practices](https://aka.ms/m365pnp)
2 changes: 1 addition & 1 deletion documentation/Get-PnPContainerTypeConfiguration.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Returns container type configuration of a SharePoint repository services applica
## SYNTAX

```powershell
Get-PnPContainerTypeConfiguration [[-Identity] <GUID>] [-Connection <PnPConnection>]
Get-PnPContainerTypeConfiguration [-Identity <GUID>] [-Connection <PnPConnection>]
```

## DESCRIPTION
Expand Down
4 changes: 2 additions & 2 deletions documentation/New-PnPContainerType.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ online version: https://pnp.github.io/powershell/cmdlets/New-PnPContainerType.ht

**Required Permissions**

* Microsoft 365 SharePoint Administrator role is required
* SharePoint Embedded Administrator or Global Administrator role is required

Creates a new SharePoint Container Type. Refer to [Hands on Lab - Setup and Configure SharePoint Embedded](https://learn.microsoft.com/en-us/sharepoint/dev/embedded/mslearn/m01-05-hol) for more details.
Create a Container Type for a SharePoint Embedded Application. Refer to [Hands on Lab - Setup and Configure SharePoint Embedded](https://learn.microsoft.com/en-us/sharepoint/dev/embedded/mslearn/m01-05-hol) for more details.

## SYNTAX

Expand Down
2 changes: 1 addition & 1 deletion documentation/Remove-PnPContainerType.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ title: Remove-PnPContainerType

**Required Permissions**

* SharePoint: Access to the SharePoint Tenant Administration site
* SharePoint Embedded Administrator or Global Administrator role is required

The Remove-PnPContainerType cmdlet removes a trial container from the SharePoint tenant. The container to remove is specified by the Identity parameter.

Expand Down
23 changes: 23 additions & 0 deletions src/Commands/Admin/GetContainerType.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
using Microsoft.Online.SharePoint.TenantAdministration;
using Microsoft.SharePoint.Client;
using PnP.PowerShell.Commands.Base;
using PnP.PowerShell.Commands.Base.PipeBinds;
using PnP.PowerShell.Commands.Utilities;
using System;
using System.Collections.Generic;
using System.Management.Automation;

namespace PnP.PowerShell.Commands.Admin
{
[Cmdlet(VerbsCommon.Get, "PnPContainerType")]

public class PnPContainerType : PnPAdminCmdlet
{
protected override void ExecuteCmdlet()
{
IList<SPContainerTypeProperties> containerTypes = Tenant.GetSPOContainerTypes(SPContainerTypeTenantType.OwningTenant);
AdminContext.ExecuteQueryRetry();
WriteObject(containerTypes, true);
}
}
}

0 comments on commit 0d546e7

Please sign in to comment.