In this post, we will be looking at the three new methods added to the ProjectWise Folder object with the latest release of the PWPS_DAB module (18.104.22.168). These methods offer a quick way to navigate to the folder within ProjectWise Explorer and to retrieve the documents contained within the folder or the folder and all subfolders.
All of the ProjectWise related cmdlets are available using the PWPS_DAB module. At the time of this post, I am using version 22.214.171.124. Take a look at the help for each of the cmdlets to become familiar with their functionality, available parameters, etc.
Get Folder Object
First thing we need to do is get our ProjectWise Folder object to work with. Here I will be selecting the folder by FolderID and grabbing only ONE folder.
$pwFolder = Get-PWFolders -FolderID 177 -JustOne
We can use the Get-Member cmdlet to look at the available methods for a ProjectWise Folder object. Here we will pipe the folder object to the Get-Member cmdlet. We are only concerned with the methods, so we use the Where-Object to filter the returned data.
$pwFolder | Get-Member | Where-Object MemberType -eq Method
The following shows the available methods. Notice we have three new ones.
GetFolderDocuments / GetTreeDocuments
One caveat with using these methods is that NOT all of the metadata associated with the documents is returned. However, you could use something like the following to resolve that.
$pwDocumentsByGUID = Get-PWDocumentsByGUIDs -DocumentGUIDs ($pwDocuments.DocumentGUID).Guid
The first method, .GetFolderDocuments() offers a quick way to retrieve all of the documents within the folder identified within the ProjectWise Folder object Only.
$pwDocuments = $pwFolder.GetFolderDocuments()
The second method, .GetTreeDocuments() offers a quick way to retrieve all of the documents with the folder identified within the ProjectWise Folder object, and all documents within any subfolders.
$pwDocuments_EntireProject = $pwFolder.GetTreeDocuments()
The following shows the results.
Now that we have our folder object, we can use the new .Locate() method to navigate to the corresponding folder within ProjectWise Explorer.
Experiment with it and have fun.
Hopefully, you find this useful. Please let me know if you have any questions or comments. If you like this post, please click the Like button at the bottom of the page.