Export-PWDocuments Relative Path For References

When attempting to export documents from ProjectWise using the Powershell command Export-PWDocuments, the references are using DMS paths still instead of relative paths based on the export location. When performing the same action using the Export Folders tool inside of ProjectWise Explorer, there's an option called "Update documents to use local paths for references and links" that works and changes the reference paths. How can this be done using the Powershell commands?

Examples of script we've used:

<#Delcare Vars#>
$LocalFolder = 'D:\_idcWork\pwArchiveStructure\BAM Training 2'
$PWFolderPath = '\Training\BAM Training'

<#Export Docs#>
Export-PWDocuments -InputDocuments (Get-PWDocumentsBySearch -FolderPath "$PWFolderPath") -OutputFolder "$LocalFolder" -Verbose

Export-PWDocuments -OutputFolder "$LocalFolder" -ProjectWiseFolder "$PWFolderPath" -Verbose

The script above pulls references, but the references are still using DMS folder paths instead of the relative local paths.

Parents Reply
  • Actually from the first message you posted, it doesn't look like you were using the -UseDMSFolders switch in the first place.  You could try that and see if the references resolve any better after opening a master file from the exported DMS folder.  You can add the -UseDMSFolders switch to the last two lines of your script as follows:

    <#Export Docs#>
    Export-PWDocuments -InputDocuments (Get-PWDocumentsBySearch -FolderPath "$PWFolderPath") -OutputFolder "$LocalFolder" -Verbose -UseDMSFolders

    Export-PWDocuments -OutputFolder "$LocalFolder" -ProjectWiseFolder -UseDMSFolders "$PWFolderPath" -Verbose -UseDMSFolders 

    Let us know.


    Mark Weisman | Bentley Systems