I’m trying to use PNP-PowerShell to create a copy of a Sharepoint 2013 List Workflow on SharePoint Online. My script is as follows:
Connect-PnPOnline https://tenant.sharepoint.com/sites/site -Credentials o365
$wf = Get-PnPWorkflowDefinition -Name 'QuickPublish V2'
$wf.DisplayName = 'QuickPublish V3'
Add-PnPWorkflowDefinition -Definition $wf
Get-PnPWorkflowDefinition |select displayname, Id |ft
After running the script I do not see the 'QuickPublish V3' in sharepoint designer. The Add-PnPWorkflowDefinition command is returning the id of the existing workflow, so it seems to me that this is just updating the existing workflow.
How can I make a copy of a workflow with PNP-PowerShell