This repository was archived by the owner on Jan 19, 2021. It is now read-only.

Description
Reporting an Issue or Missing Feature
When uploading a file with Add-PnPFile values for Modified & Created are ignored
Expected behavior
PS > $pubdate
Thursday, 19 November 2015 2:47:38 PM
PS > $pubdate.GetType()
IsPublic IsSerial Name BaseType
True True DateTime System.ValueType
PS > Add-PnPFile -Path $path -Folder $folder -Values @{Modified="$pubdate"; Created="$pubdate"}
Name Type Items/Size Last Modified
2015_07 Annual Leave.pdf File 57000 19/11/2015 2:47:38 PM
Actual behavior
PS > $pubdate
Thursday, 19 November 2015 2:47:38 PM
PS > $pubdate.GetType()
IsPublic IsSerial Name BaseType
True True DateTime System.ValueType
PS > Add-PnPFile -Path $path -Folder $folder -Values @{Modified="$pubdate"; Created="$pubdate"}
Name Type Items/Size Last Modified
2015_07 Annual Leave.pdf File 57000 7/05/2018 5:49:01 AM
Steps to reproduce behavior
Happens with every file upload for me, I can't set the modified or created date no matter what I do.
However I can create a new Date & Time column and set that just fine.
Which version of the PnP-PowerShell Cmdlets are you using?
What is the version of the Cmdlet module you are running?
SharePointPnPPowerShellOnline 2.25.1804.1
How did you install the PnP-PowerShell Cmdlets?