Bentley Communities
Bentley Communities
  • Site
  • User
  • Site
  • Search
  • User
ProjectWise
  • Product Communities
ProjectWise
ProjectWise PowerShell Extensions Forum using where-object to compare ProjectWise userlist
    • Sign In

    • State Suggested Answer
    • Replies 5 replies
    • Answers 1 answer
    • Subscribers 65 subscribers
    • Views 750 views
    • Users 0 members are here

    using where-object to compare ProjectWise userlist

    Stephen Herrick
    Offline Stephen Herrick over 2 years ago

    All,

    im sure this PS 101, but i cant seem to get tjhis to work

    i am reading a excel file, and getting a value, i then want to do a comparison to see if a UserList is created, 

     Get-PWUserLists | where-object {$_.Name -Like $Workbooks[0].Client}

    the "Client" value is Holly

    Tjhe UserList Name is "HollyProjects - All Holly Groups"

    but when i run the line, i dont get any output, so why isn't the -Like statement working.....

    TIA

    Stephen

    • Sign in to reply
    • Cancel

    Top Replies

    • Brian Flaherty
      Offline Brian Flaherty Wed, Apr 28 2021 12:36 PM +1
      Try Get-PWUserLists | Where-Object Name -Match $Workbooks[0].Client Ensure the $Workbooks[0].Client is returning what you are expecting. Should be a string value I would guess.
    • Brandon Williams
      Offline Brandon Williams Wed, Apr 28 2021 12:47 PM +1
      I would also try Get-PWUserLists | where-object {$_.Name -Like "*$($Workbooks[0].Client)*"}

    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