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

Add-PnPFile can't write Values Modified & Created #1550

@scottchristian

Description

@scottchristian

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?

  • PnP PowerShell for SharePoint 2013
  • PnP PowerShell for SharePoint 2016
  • PnP PowerShell for SharePoint Online

What is the version of the Cmdlet module you are running?

SharePointPnPPowerShellOnline 2.25.1804.1

How did you install the PnP-PowerShell Cmdlets?

  • MSI Installed downloaded from GitHub
  • Installed through the PowerShell Gallery with Install-Module
  • Other means

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions