using Copy-PWDocumentsBetweenDatasources appears to set the datetime stamp for Create and file update as 8 hours off. Example: source create time = 2/19/2003 5:28:03 PM and the target after the copy process = 2/19/2003 9:28:03 AM.
I did test out with a copy/drag to both sources a file and the timestamp is correct so it is not the server time that is the problem.
is there utc option that is not being account for? PST settings?
Are these datasources in the same or different time zones? Are they using UTC time? Is one using UTC time but not the other?
Thanks,
Mark Weisman | Bentley Systems
PWPS_DAB 23.0.3.0 has updated the Copy-PWDocumentsBetweenDatasources with a -ConvertToUTC switch. That might fix the issue.
NAME Copy-PWDocumentsBetweenDatasources SYNOPSIS Copies documents to a target folder in another datasource. SYNTAX Copy-PWDocumentsBetweenDatasources [-InputDocuments] <ProjectWiseDocument[]> [-TargetDatasource] <string> [-TargetFolderPath] <string> [[-IncludeAuditTrail] <SwitchParameter>] [[-ActiveDocumentsOnly] <SwitchParameter>] [[-ConvertToUTC] <SwitchParameter>] [<CommonParameters>] DESCRIPTION Takes an array of document objects from the pipeline and copies them to a target folder in another datasource. PARAMETERS -InputDocuments <ProjectWiseDocument[]> Array of document objects from pipeline (Required). -TargetDatasource <string> Target datasource name (Required). -TargetFolderPath <string> Path to target folder (Required). -IncludeAuditTrail <SwitchParameter> Include Audit Trail. -ActiveDocumentsOnly <SwitchParameter> Active documents only. Filters version documents from input list. -ConvertToUTC <SwitchParameter> Converts timestamps to utc. <CommonParameters> This cmdlet supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, WarningVariable, OutBuffer, PipelineVariable, and OutVariable. For more information, see about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216). ---------- EXAMPLE 1 ---------- #Get documents and copy them to a target folder in another datasource New-PWLogin ServerName:SourceDatasourceName $docs = Show-PWDocumentSelectionDialog $encryptedPassword = Read-Host -Prompt "Enter Password:" -AsSecureString New-PWLogin ServerName:TargetDatasourceName -UserName pwadmin -Password $encryptedPassword $folder = Show-PWFolderBrowserDialog Set-PWSession ServerName:SourceDatasourceName Copy-PWDocumentsBetweenDatasources $docs -TargetDatasource ServerName:TargetDatasourceName -TargetFolderPath $folder.FullPath REMARKS To see the examples, type: "get-help Copy-PWDocumentsBetweenDatasources -examples". For more information, type: "get-help Copy-PWDocumentsBetweenDatasources -detailed". For technical information, type: "get-help Copy-PWDocumentsBetweenDatasources -full".