Bentley Communities
Bentley Communities
  • Site
  • User
  • Site
  • Search
  • User
ProjectWise
  • Product Communities
ProjectWise
ProjectWise PowerShell Extensions Forum Couple of bugs in Add-PWSavedSearch and Add-PWSavedSearchOrGroup
    • Sign In

    • State Not Answered
    • Replies 3 replies
    • Subscribers 65 subscribers
    • Views 154 views
    • Users 0 members are here

    Couple of bugs in Add-PWSavedSearch and Add-PWSavedSearchOrGroup

    Kevin van Haaren
    Offline Kevin van Haaren 4 months ago

    I ran a script to create a saved search in a work area, search was an or search with 2 search terms. First was looking for files with Status of Exported, 2nd was for files with Status 'CheckedOut'

    When I open the search in Search Builder I can see it created the search with 2 or group tabs, but the 2 Status terms are both in the first Or Group. Also the search for 'CheckedOut' was listed as Document is '' with just the 2 quote marks.

    I tested creating a single term search and the status for 'CheckedOut' was still just the 2 quote marks.

    Script:

    $pwfSplat = @{
    	FolderPath    = 'Path\To\Test\WorkArea'
    	PopulatePaths = $true
    	JustOne       = $true
    }
    $pwf = Get-PWFolders @pwfSplat
    Write-Host "Found folder $($pwf.FullPath)"
    Write-Host "Creating Search Term 1"
    $searchterm1 = @{
    	SearchName       = 'Checked Out or Exported'
    	ViewName         = 'Managed Workspace'
    	OwnerProject     = $pwf
    	ReplaceExisting  = $true
    	SearchFolder     = $pwf.FullPath
    	SearchSubFolders = $true
    	Status           = 'Exported'
    }
    $result = Add-PWSavedSearch @searchterm1 -verbose
    
    Write-Host "Search Term 1 Created, Creating Search Term 2"
    $searchterm2 = @{
    	SearchName       = (Join-Path $pwf.FullPath 'Checked Out or Exported')
    	SearchFolder     = $pwf.FullPath
    	SearchSubFolders = $true
    	Status           = 'CheckedOut'
    }
    $result = Add-PWSavedSearchOrGroup @searchterm2 -verbose
    Write-Host "Search Term 2 Created"

    Screenshots of results:

    - OR Group (1) from creating both search terms

    - OR Group (2)

    • Sign in to reply
    • Cancel
    Parents
    • Brian Flaherty
      0 Offline Brian Flaherty Thu, May 18 2023 11:42 AM

      Just curious, could you use something like 'Not Checked In'?

      • Cancel
      • Vote Up 0 Vote Down
      • Sign in to reply
      • Verify Answer
      • Cancel
    Reply
    • Brian Flaherty
      0 Offline Brian Flaherty Thu, May 18 2023 11:42 AM

      Just curious, could you use something like 'Not Checked In'?

      • Cancel
      • Vote Up 0 Vote Down
      • Sign in to reply
      • Verify Answer
      • Cancel
    Children
    • Kevin van Haaren
      0 Offline Kevin van Haaren Thu, May 18 2023 11:45 AM in reply to Brian Flaherty

      Not Checked In includes files in Final Status and I don't want those one.

       

      • Cancel
      • Vote Up 0 Vote Down
      • Sign in to reply
      • Verify Answer
      • Cancel
    • Brian Flaherty
      0 Offline Brian Flaherty Thu, May 18 2023 11:50 AM in reply to Kevin van Haaren

      Gotcha. Didn't consider 'Final Status'.

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

    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