Bentley Communities
Bentley Communities
  • Site
  • User
  • Site
  • Search
  • User
ProjectWise
  • Product Communities
ProjectWise
ProjectWise PowerShell Extensions Forum searching for files that have apostrophes
    • Sign In

    • State Verified Answer
    • Replies 12 replies
    • Answers 1 answer
    • Subscribers 66 subscribers
    • Views 1204 views
    • Users 0 members are here

    searching for files that have apostrophes

    Stephen Herrick
    Offline Stephen Herrick over 2 years ago

    All,

    i am exporting documents using 

     Get-PWDocumentsBySearch -FolderPath $RootProject.FullPath -FileName $file -GetVersionsToo | Export-PWDocuments -OutputFolder $CopyTo -Verbose

    i am reading a csv file to get the list of files i need to search and export, the file names are very long and some have special characters as shown below

    2021-07-15_Sub 1497.A_Flatiron-Lane JV, May Creek Bridge Southbound Wave Equation Analysis, PP30'x0.625', APE D50-42 and .pdf

    When i search for the document using ProjectWise search, it finds the document

    however when i run the cmdlet, it errors, stating file not found

    when i expand the variable using the write-host is shows the following

    @{Files_to_Export=2021-07-15_Sub 1497.A_Flatiron-Lane JV, May Creek Bridge Southbound Wave Equation Analysis, PP30'x0.625', APE D50-42 and .pdf}

    but of course when i expand the variable is shows thename im looking for

    PS C:\WINDOWS\system32> $File

    Files_to_Export
    ---------------
    2021-07-15_Sub 1497.A_Flatiron-Lane JV, May Creek Bridge Southbound Wave Equation Analysis, PP30'x0.625', APE D50-42 and .pdf

    what am i doing wrong,

    TIA

    Stephen

    • Sign in to reply
    • Cancel

    Top Replies

    • Brian Flaherty
      Offline Brian Flaherty Thu, Jul 29 2021 11:58 AM in reply to Stephen Herrick +1 verified
      You can try using the Export-PWDocuments with the -UseDMSFolders switch parameter.

    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