Skip to content
Merged
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
6 changes: 3 additions & 3 deletions src/Commands/Webhooks/SetWebhookSubscription.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ namespace PnP.PowerShell.Commands.Webhooks
[OutputType(typeof(WebhookSubscription))]
public class SetWebhookSubscription : PnPWebCmdlet
{
public const int DefaultValidityInMonths = 6;
public const int DefaultValidityInDays = 180; // Note: the max is 180 days not 6 months - https://learn.microsoft.com/sharepoint/dev/apis/webhooks/overview-sharepoint-webhooks
public const int ValidityDeltaInDays = -72; // Note: Some expiration dates too close to the limit are rejected

[Parameter(Mandatory = true, ValueFromPipeline = true, Position = 0)]
public WebhookSubscriptionPipeBind Subscription;

Expand All @@ -24,7 +24,7 @@ public class SetWebhookSubscription : PnPWebCmdlet
public string NotificationUrl;

[Parameter(Mandatory = false)]
public DateTime ExpirationDate = DateTime.Today.ToUniversalTime().AddMonths(DefaultValidityInMonths).AddHours(ValidityDeltaInDays);
public DateTime ExpirationDate = DateTime.Today.ToUniversalTime().AddDays(DefaultValidityInDays).AddHours(ValidityDeltaInDays);

protected override void ExecuteCmdlet()
{
Expand Down