Add-PnPListItem creates empty item when duplicate detected (with enforce unique item column setting)
Reporting an Issue or Missing Feature
When I use add-pnplistitem to create a new list item on a list that has Enforce Unique Items set and it detects a duplicate, the exception is reported, but an empty item is created.
Expected behavior
When using CSOM through PowerShell, hitting this same scenario does not add an empty list item, therefore I would expect the PNP cmdlet to have the same behaviour.
Actual behavior
Please describe what you see instead. Please provide samples of HTML output or screenshots

Steps to reproduce behavior
Configure a new custom list. Add the Enforce Unique Items restriction to the Title field run the following cmdlets after connecting using connect-pnponline
Add-PnPListItem -List $listName -ContentType "Item" -Values @{"Title"="Valid New Item 1"} Add-PnPListItem -List $listName -ContentType "Item" -Values @{"Title"="Valid New Item 2"} Add-PnPListItem -List $listName -ContentType "Item" -Values @{"Title"="Valid New Item 2"}
Which version of the PnP-PowerShell Cmdlets are you using?
- [ ] PnP PowerShell for SharePoint 2013
- [ ] PnP PowerShell for SharePoint 2016
- [x] PnP PowerShell for SharePoint Online
What is the version of the Cmdlet module you are running?
2.16.1706.1
How did you install the PnP-PowerShell Cmdlets?
- [x] MSI Installed downloaded from GitHub
- [ ] Installed through the PowerShell Gallery with Install-Module
- [ ] Other means
Steps to reproduce behavior
Configure a new custom list. Add the Enforce Unique Items restriction to the Title field run the following cmdlets after connecting using connect-pnponline
Add-PnPListItem -List $listName -ContentType "Item" -Values @{"Title"="Valid New Item 1"} Add-PnPListItem -List $listName -ContentType "Item" -Values @{"Title"="Valid New Item 2"} Add-PnPListItem -List $listName -ContentType "Item" -Values @{"Title"="Valid New Item 2"}
I don't see an empty record, however I noticed that it uses a list item ID. So When I run the next command Add-PnPListItem -List $listName -ContentType "Item" -Values @{"Title"="Valid New Item 3"} The Item Id is now 4 instead of 3.
Which version of the PnP-PowerShell Cmdlets are you using?
- [ ] PnP PowerShell for SharePoint 2013
- [x] PnP PowerShell for SharePoint 2016
- [ ] PnP PowerShell for SharePoint Online
What is the version of the Cmdlet module you are running?
2.16.1706.1
How did you install the PnP-PowerShell Cmdlets?
- [ ] MSI Installed downloaded from GitHub
- [x] Installed through the PowerShell Gallery with Install-Module
- [ ] Other means
@cimares - I'm seeing this too. @peterdmendez - I though to check to see if the uniqueness check was somehow 'tied' to the default Title field (in my environment I'm using another column for a unique 'key-value'), but in my testing it makes no difference which column I assign enforce unique values to, I still get blank entries for duplicate values. I concur with @cimares, I'd much rather see that the item is not created, rather than have duplicates with blank fields created.