File date metadata not displaying properly

后端 未结 2 1309
梦如初夏
梦如初夏 2020-12-11 23:12

I have been trying to write a Powershell script based on some code online that will read the metadata info from picture, video and other files and then sort them based on on

2条回答
  •  南方客
    南方客 (楼主)
    2020-12-11 23:32

    When I run your code, $objFolder.GetDetailsOf($objFolder.Items().Item(0), 12) I get an empty string. I even changed the item number and the folder I was looking in to make sure I was getting a file object.

    However if I do this:

    $objShell = New-Object -ComObject Shell.Application
    $objFolder = $objShell.namespace("C:\Temp")
    $date = $objFolder.Items().Item(3).ModifyDate
    

    I get a value that is already a DateTime object.

    (the code above uses my folder and item index)

提交回复
热议问题