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

Adds AllowTenantMoveWithDataMigration parameter for PlannerConfiguration cmdlets #1934

Merged
merged 5 commits into from
Jun 9, 2022
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 @@ -41,6 +41,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
- Added `-IncludeDeprecated` parameter to `Get-PnPTerm` cmdlet to fetch deprecated terms if specified [#1903](https://github.com/pnp/powershell/pull/1903)
- Added `-IncludeContentType` parameter, which if specified will retrieve content type information of the list items. [#1921](https://github.com/pnp/powershell/pull/1921)
- Added optional `-ValidateConnection` to `Connect-PnPOnline` which will check if the site you are connecting to exists and if not, will throw an exception [#1924](https://github.com/pnp/powershell/pull/1924)
- Added `AllowTenantMoveWithDataMigration` to `Get-PnPPlannerConfiguration` and `Set-PnPPlannerConfiguration` [#1934](https://github.com/pnp/powershell/pull/1934)
- Added `Add-PnPListItemAttachment` cmdlet to provide ability to upload a file as an attachment to a SharePoint list item. [#1932](https://github.com/pnp/powershell/pull/1932)
- Added `Remove-PnPListItemAttachment` cmdlet to provide ability to delete a list item attachment. [#1932](https://github.com/pnp/powershell/pull/1932)
- Added `Get-PnPListItemAttachment` cmdlet to download the attachments from a list item. [#1932](https://github.com/pnp/powershell/pull/1932)
Expand Down
17 changes: 16 additions & 1 deletion documentation/Set-PnPPlannerConfiguration.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Allows the Microsoft Planner configuration of the tenant to be set
## SYNTAX

```
Set-PnPPlannerConfiguration [-IsPlannerAllowed <boolean>] [-AllowRosterCreation <boolean>] [-AllowTenantMoveWithDataLoss <boolean>] [-AllowPlannerMobilePushNotifications <boolean>] [-AllowCalendarSharing <boolean>] [-Connection <PnPConnection>] [<CommonParameters>]
Set-PnPPlannerConfiguration [-IsPlannerAllowed <boolean>] [-AllowRosterCreation <boolean>] [-AllowTenantMoveWithDataLoss <boolean>] [-AllowTenantMoveWithDataMigration <boolean>] [-AllowPlannerMobilePushNotifications <boolean>] [-AllowCalendarSharing <boolean>] [-Connection <PnPConnection>] [<CommonParameters>]
```

## DESCRIPTION
Expand Down Expand Up @@ -79,6 +79,21 @@ Accept pipeline input: False
Accept wildcard characters: False
```

### -AllowTenantMoveWithDataMigration
Allows configuring whether a tenant move with data migration is authorized

```yaml
Type: Boolean
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -AllowPlannerMobilePushNotifications
Allows configuring whether the direct push notifications are enabled where contents of the push notification are being sent directly through Apple's or Google's services to get to the iOS or Android client

Expand Down
6 changes: 6 additions & 0 deletions src/Commands/Model/Planner/PlannerTenantConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ public class PlannerTenantConfig
[JsonPropertyName("allowTenantMoveWithDataLoss")]
public bool? AllowTenantMoveWithDataLoss { get; set; }

/// <summary>
/// Indicates whether a tenant move with data migration is authorized.
/// </summary>
[JsonPropertyName("allowTenantMoveWithDataMigration")]
public bool? AllowTenantMoveWithDataMigration { get; set; }

/// <summary>
/// Indicates whether the creation of Roster containers (Planner plans without Microsoft 365 Groups) is allowed
/// </summary>
Expand Down
6 changes: 3 additions & 3 deletions src/Commands/Planner/GetPlannerConfiguration.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
using PnP.PowerShell.Commands.Attributes;
using System.Management.Automation;
using PnP.PowerShell.Commands.Attributes;
using PnP.PowerShell.Commands.Base;
using PnP.PowerShell.Commands.Utilities;
using System.Management.Automation;

namespace PnP.PowerShell.Commands.PowerPlatform.PowerAutomate
namespace PnP.PowerShell.Commands.Planner
{
[Cmdlet(VerbsCommon.Get, "PnPPlannerConfiguration")]
[RequiredMinimalApiPermissions("https://tasks.office.com/.default")]
Expand Down
7 changes: 5 additions & 2 deletions src/Commands/Planner/SetPlannerConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using PnP.PowerShell.Commands.Utilities;
using System.Management.Automation;

namespace PnP.PowerShell.Commands.PowerPlatform.PowerAutomate
namespace PnP.PowerShell.Commands.Planner
{
[Cmdlet(VerbsCommon.Set, "PnPPlannerConfiguration")]
[RequiredMinimalApiPermissions("https://tasks.office.com/.default")]
Expand All @@ -18,6 +18,9 @@ public class SetPlannerConfiguration : PnPGraphCmdlet
[Parameter(Mandatory = false)]
public bool? AllowTenantMoveWithDataLoss;

[Parameter(Mandatory = false)]
public bool? AllowTenantMoveWithDataMigration;

[Parameter(Mandatory = false)]
public bool? AllowPlannerMobilePushNotifications;

Expand All @@ -26,7 +29,7 @@ public class SetPlannerConfiguration : PnPGraphCmdlet

protected override void ExecuteCmdlet()
{
var result = PlannerUtility.SetPlannerConfigAsync(HttpClient, AccessToken, IsPlannerAllowed, AllowCalendarSharing, AllowTenantMoveWithDataLoss, AllowRosterCreation, AllowPlannerMobilePushNotifications).GetAwaiter().GetResult();
var result = PlannerUtility.SetPlannerConfigAsync(HttpClient, AccessToken, IsPlannerAllowed, AllowCalendarSharing, AllowTenantMoveWithDataLoss, AllowTenantMoveWithDataMigration, AllowRosterCreation, AllowPlannerMobilePushNotifications).GetAwaiter().GetResult();
WriteObject(result);
}
}
Expand Down
3 changes: 2 additions & 1 deletion src/Commands/Utilities/PlannerUtility.cs
Original file line number Diff line number Diff line change
Expand Up @@ -322,13 +322,14 @@ public static async Task<PlannerTenantConfig> GetPlannerConfigAsync(HttpClient h
/// <param name="httpClient">HttpClient instance to use to send out requests</param>
/// <param name="accessToken">AccessToken to use to authenticate the request</param>
/// <returns>PlannerTenantConfig</returns>
public static async Task<PlannerTenantConfig> SetPlannerConfigAsync(HttpClient httpClient, string accessToken, bool? isPlannerAllowed, bool? allowCalendarSharing, bool? allowTenantMoveWithDataLoss, bool? allowRosterCreation, bool? allowPlannerMobilePushNotifications)
public static async Task<PlannerTenantConfig> SetPlannerConfigAsync(HttpClient httpClient, string accessToken, bool? isPlannerAllowed, bool? allowCalendarSharing, bool? allowTenantMoveWithDataLoss, bool? allowTenantMoveWithDataMigration, bool? allowRosterCreation, bool? allowPlannerMobilePushNotifications)
{
var content = new PlannerTenantConfig
{
IsPlannerAllowed = isPlannerAllowed,
AllowCalendarSharing = allowCalendarSharing,
AllowTenantMoveWithDataLoss = allowTenantMoveWithDataLoss,
AllowTenantMoveWithDataMigration = allowTenantMoveWithDataMigration,
AllowRosterCreation = allowRosterCreation,
AllowPlannerMobilePushNotifications = allowPlannerMobilePushNotifications
};
Expand Down