How to find location of local path of exported file

Hi,

When I export a file it nicely is shown in the file organizer where it is exported to.

There is a  [ProjectWiseDocument]$doc0PwObject.CheckedOutLocalFileName, but this remains empty

How can I find the location to which the file was exported to?

Thanks in advance.

Parents
  • Not sure where local document organizer gets the info from but the only way i'm finding to get it is via the document's audit trail.

    (side note: CheckedOutLocalFileName only gets populated when checking out the file with CheckOut-PWDocument. Using Get-PWDocumentsBySearch, including with the -Slow option, will not populate that field even if you already have the file checked out.)

    Using Get-PWDocumentAuditTrailRecords I was able to retrieve the info. This may be slow if your documents have a lot of audit trail records.

    $atrails = Get-PWDocumentAuditTrailRecords -FolderPath 'pw\path' -DocumentName 'TestFile.txt'
    $expRec = @($atrails | Where Action -eq 'Document Export' | Sort Action_Time -Descending)[0]
    $expRec | Select Action_Time,Action,Item_Name,Text_Param
    ($Node,$Path) = $expRec.Text_Param.Split('|')
    
    

    The line where i put @() around the statements is a trick to force the results of the commands into an array. The [0] gets the first element of the array (which because we sorted by the action time will be the last export that occurred)

    The Text_Param propert of the audit trail contains the path info. It's in the form of the node where it was exported, vertical bar, path it was exported to.

    You should verify the file is still actually exported before using this, if the file was freed or imported since the export the above will still find the info for the last time the file was exported even though it's no longer valid.

     

Reply
  • Not sure where local document organizer gets the info from but the only way i'm finding to get it is via the document's audit trail.

    (side note: CheckedOutLocalFileName only gets populated when checking out the file with CheckOut-PWDocument. Using Get-PWDocumentsBySearch, including with the -Slow option, will not populate that field even if you already have the file checked out.)

    Using Get-PWDocumentAuditTrailRecords I was able to retrieve the info. This may be slow if your documents have a lot of audit trail records.

    $atrails = Get-PWDocumentAuditTrailRecords -FolderPath 'pw\path' -DocumentName 'TestFile.txt'
    $expRec = @($atrails | Where Action -eq 'Document Export' | Sort Action_Time -Descending)[0]
    $expRec | Select Action_Time,Action,Item_Name,Text_Param
    ($Node,$Path) = $expRec.Text_Param.Split('|')
    
    

    The line where i put @() around the statements is a trick to force the results of the commands into an array. The [0] gets the first element of the array (which because we sorted by the action time will be the last export that occurred)

    The Text_Param propert of the audit trail contains the path info. It's in the form of the node where it was exported, vertical bar, path it was exported to.

    You should verify the file is still actually exported before using this, if the file was freed or imported since the export the above will still find the info for the last time the file was exported even though it's no longer valid.

     

Children