Bentley Communities
Bentley Communities
  • Site
  • User
  • Site
  • Search
  • User
ProjectWise
  • Product Communities
ProjectWise
ProjectWise PowerShell Extensions Forum Using Copy-PWDocumentsBetweenDatasources appears to set the datetime stamp Incorrectly.
    • Sign In

    • State Not Answered
    • Replies 12 replies
    • Subscribers 66 subscribers
    • Views 492 views
    • Users 0 members are here

    Using Copy-PWDocumentsBetweenDatasources appears to set the datetime stamp Incorrectly.

    blotto
    Offline blotto 7 months ago

    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?

    • Sign in to reply
    • Cancel
    Parents
    • blotto
      0 Offline blotto Thu, Mar 2 2023 1:28 PM
      Same time zone and on same SQL instance.
      I should say, though, the source records are from earlier version of the design integration that goes back to v8i. Not sure if that makes any difference.
       
       
      Brian Otto
      IT Specialist – JST CAD Support
      Bonneville Power Administration
      (360) 619-6893
       
      • Cancel
      • Vote Up 0 Vote Down
      • Sign in to reply
      • Verify Answer
      • Cancel
    • Kevin van Haaren
      0 Offline Kevin van Haaren Fri, Mar 3 2023 12:01 PM in reply to blotto

      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".
      
      
      
      
      

       

      • Cancel
      • Vote Up 0 Vote Down
      • Sign in to reply
      • Verify Answer
      • Cancel
    Reply
    • Kevin van Haaren
      0 Offline Kevin van Haaren Fri, Mar 3 2023 12:01 PM in reply to blotto

      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".
      
      
      
      
      

       

      • Cancel
      • Vote Up 0 Vote Down
      • Sign in to reply
      • Verify Answer
      • Cancel
    Children
    No Data

    Communities
    • Home
    • Getting Started
    • Community Central
    • Products
    • Support
    • Secure File Upload
    • Feedback
    Support and Services
    • Home
    • Product Support
    • Downloads
    • Subscription Services Portal
    Training and Learning
    • Home
    • About Bentley Institute
    • My Learning History
    • Reference Books
    Social Media
    •    LinkedIn
    •    Facebook
    •    Twitter
    •    YouTube
    •    RSS Feed
    •    Email

    © 2023 Bentley Systems, Incorporated  |  Contact Us  |  Privacy |  Terms of Use  |  Cookies