1

I have this PnP-Powershell line that gives the last date in het column Date of a SharePoint list. Even thou in the list column are only dates displayed. With this command i get also the time. How can i only get the date.

Write-Host "Stand-By rooster XXXXXX: " (Get-PnPListItem -List "Stand-By rooster XXXXXXX | select -Last 1)["Datum"]

  • 1
    With a datetime object (which is what you get from (Get-PnPListItem -List "Stand-By rooster XXXXXXX | select -Last 1)["Datum"]) you can use different methods to format the date. Take a look here for examples: docs.microsoft.com/en-us/powershell/module/… Be advised that the datetime returned from SharePoint might be in another time zone that your computer is. – R. Sperre Dec 1 '18 at 19:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.