Set-PnPWebhookSubscription

Updates a Webhook subscription

Syntax

Set-PnPWebhookSubscription
   -Subscription <WebhookSubscriptionPipeBind>
                             [-List <ListPipeBind>]
                             [-NotificationUrl <String>]
                             [-ExpirationDate <DateTime>]
                             [-Web <WebPipeBind>]
                             [-Connection <SPOnlineConnection>]

Examples

------------------EXAMPLE 1------------------

Set-PnPWebhookSubscription -List MyList -Subscription ea1533a8-ff03-415b-a7b6-517ee50db8b6 -NotificationUrl https://my-func.azurewebsites.net/webhook

Updates an existing Webhook subscription with the specified id on the list MyList with a new Notification Url

------------------EXAMPLE 2------------------

Set-PnPWebhookSubscription -List MyList -Subscription ea1533a8-ff03-415b-a7b6-517ee50db8b6 -NotificationUrl https://my-func.azurewebsites.net/webhook -ExpirationDate "2017-09-01"

Updates an existing Webhook subscription with the specified id on the list MyList with a new Notification Url and a new expiration date

------------------EXAMPLE 3------------------

$subscriptions = Get-PnPWebhookSubscriptions -List MyList
$updated = $subscriptions[0]
$updated.ExpirationDate = "2017-10-01"
Set-PnPWebhookSubscription -List MyList -Subscription $updated

Updates the Webhook subscription from the list MyList with a modified subscription object. Note: The date will be converted to Universal Time

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.

Type:SPOnlineConnection
Position:Named
Accept pipeline input:False
Accept wildcard characters:False
-ExpirationDate

The date at which the Webhook subscription will expire. (Default: 6 months from today)

Type:DateTime
Position:Named
Accept pipeline input:False
Accept wildcard characters:False
-List

The list object or name from which the Webhook subscription will be modified

Type:ListPipeBind
Position:Named
Accept pipeline input:False
Accept wildcard characters:False
-NotificationUrl

The URL of the Webhook endpoint that will be notified of the change

Type:String
Position:Named
Accept pipeline input:False
Accept wildcard characters:False
-Subscription

The identity of the Webhook subscription to update

Type:WebhookSubscriptionPipeBind
Position:0
Accept pipeline input:True
Accept wildcard characters:False
-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type:WebPipeBind
Position:Named
Accept pipeline input:False
Accept wildcard characters:False

Outputs

OfficeDevPnP.Core.Entities.WebhookSubscription