-
Notifications
You must be signed in to change notification settings - Fork 356
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature: Add Get-PnPContainerTypeConfiguration cmdlet (#3660)
Co-authored-by: Gautam Sheth <[email protected]>
- Loading branch information
1 parent
b789052
commit c08c268
Showing
4 changed files
with
137 additions
and
0 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,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) |
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,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)); | ||
} | ||
} | ||
} | ||
} |
35 changes: 35 additions & 0 deletions
35
src/Commands/Model/SharePoint/SPContainerTypeConfigurationPropertiesObj.cs
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,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; | ||
} | ||
} | ||
} |