Bentley Communities
Bentley Communities
  • Site
  • User
  • Site
  • Search
  • User
ProjectWise
  • Product Communities
ProjectWise
ProjectWise PowerShell Extensions Forum how to get the folder owner propert
    • Sign In

    • State Suggested Answer
    • Replies 5 replies
    • Answers 2 answers
    • Subscribers 66 subscribers
    • Views 1077 views
    • Users 0 members are here

    how to get the folder owner propert

    Stephen Herrick
    Offline Stephen Herrick over 2 years ago

    how do you go about getting a the folder property Folder Owner,

    TIA

    Stephen

    • Sign in to reply
    • Cancel
    • Dan Williams
      0 Offline Dan Williams Thu, Mar 11 2021 10:55 PM

      Doesn't this work for you?

      I used:

      • PWPS_DAB v1.27.9.9
      • PW Explorer v10.00.02.265
      • PW Integration Server v10.00.02.265

      If the "problem" is not knowing what the property is called, try using the Get-Member Cmdlet.

      > Get-PWFolders -FolderPath 'Doc Code Tests' -JustOne | Get-Member
      
      
         TypeName: PWPS_DAB.CommonTypes+ProjectWiseFolder
      
      Name                   MemberType Definition                                                                                        
      ----                   ---------- ----------                                                                                        
      Equals                 Method     bool Equals(System.Object obj)                                                                    
      GetFolderDocuments     Method     System.Collections.Generic.List[PWPS_DAB.CommonTypes+ProjectWiseDocument] GetFolderDocuments()    
      GetFullPath            Method     string GetFullPath()                                                                              
      GetHashCode            Method     int GetHashCode()                                                                                 
      GetSubFolders          Method     System.Collections.Generic.List[PWPS_DAB.CommonTypes+ProjectWiseFolder] GetSubFolders()           
      GetTreeDocuments       Method     System.Collections.Generic.List[PWPS_DAB.CommonTypes+ProjectWiseDocument] GetTreeDocuments()      
      GetType                Method     type GetType()                                                                                    
      Locate                 Method     void Locate()                                                                                     
      LocateConnectedProject Method     void LocateConnectedProject()                                                                     
      LocateRichProject      Method     void LocateRichProject()                                                                          
      ToString               Method     string ToString()                                                                                 
      ClassID                Property   int ClassID {get;set;}                                                                            
      Code                   Property   string Code {get;set;}                                                                            
      ConnectedProjectId     Property   guid ConnectedProjectId {get;set;}                                                                
      CreateDateTime         Property   datetime CreateDateTime {get;set;}                                                                
      Description            Property   string Description {get;set;}                                                                     
      Environment            Property   string Environment {get;set;}                                                                     
      EnvironmentID          Property   int EnvironmentID {get;set;}                                                                      
      FolderCreator          Property   Bentley.ProjectWise.PowerShell.Common.User FolderCreator {get;set;}                               
      FolderCreatorName      Property   string FolderCreatorName {get;}                                                                   
      FolderDepth            Property   int FolderDepth {get;}                                                                            
      FolderDocuments        Property   System.Collections.Generic.List[PWPS_DAB.CommonTypes+ProjectWiseDocument] FolderDocuments {get;...
      FolderOwnerName        Property   string FolderOwnerName {get;set;}                                                                 
      FolderOwnerType        Property   string FolderOwnerType {get;set;}                                                                 
      FolderUpdater          Property   Bentley.ProjectWise.PowerShell.Common.User FolderUpdater {get;set;}                               
      FolderUpdaterName      Property   string FolderUpdaterName {get;}                                                                   
      FullPath               Property   string FullPath {get;set;}                                                                        
      InstanceID             Property   int InstanceID {get;set;}                                                                         
      IsParent               Property   bool IsParent {get;set;}                                                                          
      IsRichProject          Property   bool IsRichProject {get;set;}                                                                     
      Name                   Property   string Name {get;set;}                                                                            
      OldDescription         Property   string OldDescription {get;set;}                                                                  
      OldFullPath            Property   string OldFullPath {get;set;}                                                                     
      OldName                Property   string OldName {get;set;}                                                                         
      OldVersion             Property   string OldVersion {get;set;}                                                                      
      ParentID               Property   int ParentID {get;set;}                                                                           
      PreviewPaneView        Property   string PreviewPaneView {get;set;}                                                                 
      PreviewPaneViewId      Property   int PreviewPaneViewId {get;set;}                                                                  
      ProjectGUID            Property   guid ProjectGUID {get;set;}                                                                       
      ProjectGUIDString      Property   string ProjectGUIDString {get;set;}                                                               
      ProjectID              Property   int ProjectID {get;set;}                                                                          
      ProjectProperties      Property   System.Collections.Generic.Dictionary[string,string] ProjectProperties {get;set;}                 
      ProjectType            Property   int ProjectType {get;set;}                                                                        
      ProjectURN             Property   string ProjectURN {get;set;}                                                                      
      Storage                Property   string Storage {get;set;}                                                                         
      StorageFolder          Property   string StorageFolder {get;set;}                                                                   
      StorageID              Property   int StorageID {get;set;}                                                                          
      StorageNode            Property   string StorageNode {get;set;}                                                                     
      SubFolders             Property   System.Collections.Generic.List[PWPS_DAB.CommonTypes+ProjectWiseFolder] SubFolders {get;set;}     
      TreeDocuments          Property   System.Collections.Generic.List[PWPS_DAB.CommonTypes+ProjectWiseDocument] TreeDocuments {get;set;}
      Type                   Property   int Type {get;set;}                                                                               
      UpdateDateTime         Property   datetime UpdateDateTime {get;set;}                                                                
      Version                Property   string Version {get;set;}                                                                         
      View                   Property   string View {get;set;}                                                                            
      ViewID                 Property   int ViewID {get;set;}                                                                             
      Workflow               Property   string Workflow {get;set;}                                                                        
      WorkflowID             Property   int WorkflowID {get;set;}                                                                         
      

      • Cancel
      • Vote Up 0 Vote Down
      • Sign in to reply
      • Verify Answer
      • Reject Answer
      • Cancel
    • Brian Flaherty
      0 Offline Brian Flaherty Wed, Mar 17 2021 10:13 AM

      I don't believe there is a way to retrieve the current owner. We can only set the owner of a folder. Could be added if there is enough of a need.

      • Cancel
      • Vote Up 0 Vote Down
      • Sign in to reply
      • Verify Answer
      • Cancel
    • Dan Williams
      0 Offline Dan Williams Wed, Mar 17 2021 4:57 PM in reply to Brian Flaherty

      Brian Flaherty,

      Unless I don't understand the question, you can get a folder's owner like this:

      • Cancel
      • Vote Up 0 Vote Down
      • Sign in to reply
      • Verify Answer
      • Reject Answer
      • Cancel
    • Brian Flaherty
      0 Offline Brian Flaherty Thu, Mar 18 2021 10:48 AM in reply to Brian Flaherty

      Disregard my reply. I looked right pass the FolderOwner property. Thanks Dan.

      • Cancel
      • Vote Up 0 Vote Down
      • Sign in to reply
      • Verify Answer
      • Cancel
    • Dan Williams
      0 Offline Dan Williams Thu, Mar 18 2021 11:17 AM in reply to Brian Flaherty

      FWIW, as I like to say, "words get in the way"...  Unfortunately, there are multiple labels or names for the same item, property, or feature, which sometimes makes it more difficult to find what you are looking for.  And I sympathize with folks whose native language is not English since that could make identifying "similar" labels or names more difficult.

      I think part of the problem is the old joke about the "hardest thing in programming", which of course has the punchline "is naming things".

      I believe that the philosophy of using the same label or name for essentially the same thing that PowerShell appears to use, should be embraced more.  The idea that "Name" is common to so many objects, that including the object's type in the name is redundant at best, and makes it difficult or impossible for "automatic" property assignment that PowerShell does so well.  For example I think that "FolderOwnerName" should have left out the object type "Folder" and "OwnerName" or even "Owner" would have been preferable.

      But as that awful phase goes, "it is what it is".  And changing it has its own challenges..

      • 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