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

Feature: Add Get-PnPContainerTypeConfiguration cmdlet #3660

Merged
merged 1 commit into from
Dec 29, 2023
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
- Added `Convert-PnPFile` cmdlet which allows for a file to be converted to from one format to another. [#3435](https://github.com/pnp/powershell/pull/3435) & [#3643](https://github.com/pnp/powershell/pull/3643)
- Added `Merge-PnPTerm` cmdlet which allows merging of one term into another. [#3638](https://github.com/pnp/powershell/pull/3638)
- Added `Get-PnPDeletedContainer` cmdlet which returns a list of all deleted Containers in the recycle bin. [#3648](https://github.com/pnp/powershell/pull/3648)
- Added `Get-PnPContainerTypeConfiguration` cmdlet which fetches the container type configuration values.

### Contributors

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

# Get-PnPContainerTypeConfiguration

## SYNOPSIS

**Required Permissions**

* SharePoint: Access to the SharePoint Tenant Administration site

Returns container type configuration of a SharePoint repository services application.

## SYNTAX

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

## DESCRIPTION

## EXAMPLES

### EXAMPLE 1
```powershell
Get-PnPContainerTypeConfiguration -Identity a187e399-0c36-4b98-8f04-1edc167a0996
```

Returns a container type configuration data of the application created under the specified SharePoint repository services application.


## 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 container type GUID

```yaml
Type: ContainerPipeBind
Parameter Sets: (All)

Required: False
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)
29 changes: 29 additions & 0 deletions src/Commands/Admin/GetContainerTypeConfiguration.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
using Microsoft.Online.SharePoint.TenantAdministration;
using Microsoft.SharePoint.Client;
using PnP.PowerShell.Commands.Base;
using System;
using System.Management.Automation;

namespace PnP.PowerShell.Commands.Admin
{
[Cmdlet(VerbsCommon.Get, "PnPContainerTypeConfiguration")]
public class GetContainerTypeConfiguration : PnPAdminCmdlet
{
[Parameter(Mandatory = true)]
public Guid Identity;

protected override void ExecuteCmdlet()
{
if (Identity == Guid.Empty)
{
throw new ArgumentException($"Identity {Identity} value is invalid");
}
ClientResult<SPContainerTypeConfigurationProperties> sPOContainerTypeConfigurationByContainerTypeId = Tenant.GetSPOContainerTypeConfigurationByContainerTypeId(Identity);
AdminContext.ExecuteQuery();
if (sPOContainerTypeConfigurationByContainerTypeId != null && sPOContainerTypeConfigurationByContainerTypeId.Value != null)
{
WriteObject(new Model.SharePoint.SPContainerTypeConfigurationPropertiesObj(sPOContainerTypeConfigurationByContainerTypeId.Value));
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
using Microsoft.Online.SharePoint.TenantAdministration;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;

namespace PnP.PowerShell.Commands.Model.SharePoint
{
public class SPContainerTypeConfigurationPropertiesObj
{
public Guid ContainerTypeId { get; private set; }

public Guid OwningApplicationId { get; private set; }

public string ContainerTypeName { get; private set; }

public SPContainerTypeBillingClassification Classification { get; private set; }

public bool DiscoverabilityDisabled { get; private set; }

public bool SharingRestricted { get; private set; }

internal SPContainerTypeConfigurationPropertiesObj(SPContainerTypeConfigurationProperties containerTypeConfigurationProperties)
{
ContainerTypeId = containerTypeConfigurationProperties.ContainerTypeId;
OwningApplicationId = containerTypeConfigurationProperties.OwningAppId;
ContainerTypeName = containerTypeConfigurationProperties.ContainerTypeName;
Classification = containerTypeConfigurationProperties.Classification;
DiscoverabilityDisabled = containerTypeConfigurationProperties.IsDiscoverablilityDisabled;
SharingRestricted = containerTypeConfigurationProperties.IsSharingRestricted;
}
}
}
Loading