Hi all,
So I discovered we have Update-PWRichProjectProperties cmdlet to update PW projects but there is non to get the values in project properties.
For example if PROJECT_Start_Date = '2017-01-01 01:00:00' I am after a cmdlet that extract '2017-01-01 01:00:00' not PROJECT_Start_Date that I can get with Get-PWRichProjectProperties. This cmdlet doesn't accept a path to a specific project.
Regards,
Elahe
Use Get-PWRichProjects
If you want the properties from a single folder in path Projects\Example Project:
$RichProperties=(Get-PWRichProjects -FolderPath "Projects\Example Project" -JustOne).ProjectProperties
$StartDate = $RichProperties.PROJECT_Start_Date
Answer Verified By: Elahe Burns
You should also get the ProjectProperties when using Get-PWFolders and Get-PWFoldersByGUIDs.
Thanks Kevin
Helpful as usual. Problem is I don't know where to get the documentation about powershell objects and what properties and method they have and what each method do.
Microsoft has some good tutorials and documentation at:
docs.microsoft.com/.../
plus a lot of the documentation is built into powershell itself.
help command
usually brings up good stuff about command (or topic). you can use wildcards. So when you said Get-PWRichProjectProperties wasn't workin,g first i looked at the help for that. Which, for that command is really weak, but says "Get the list of available project properties in the datasource in order to specify in view definition." and that it doesn't take a folderpath argument probably means it's the wrong command.
then i used a trick of help:
help *pw*rich*
that returns a list of all projectwise commands that contain the word rich. I see a "Get-PWRichProjects" so i look at that help. that takes a folder path so i run it pointing to a rich project in my test datasource. When you run a command it usually dumps it's output to the screen. In the cases where a command returns an object it'll print out the properties that were returned. In this case:
Description Name ProjectID ProjectGUID ProjectGUIDString ProjectURN FullPath IsRichProject Environment Workflow Code Storage View PreviewPaneView ClassID InstanceID EnvironmentID WorkflowID ParentID StorageID ViewID PreviewPaneViewId IsParent OldVersion Version Type CreateDateTime UpdateDateTime OldName OldDescription OldFullPath ProjectProperties
You can also output a command to the get-member command and it will list not only the properties, but the methods as well (you can pipe variables into get-member and it'll report the same on the object in the variable). doing a get-member on the output of Get-PWRichProjects tells me that the ProjectProperties property is a System.Collections.Generic.Dictionary (also known as a Hash Table). II highly recommend learning about Hash Tables. They are super useful in powershell.
https://kevinmarquette.github.io/2016-11-06-powershell-hashtable-everything-you-wanted-to-know-about/
anyway, as you learn more most of this will start popping into your head. I have very little of the projectwise powershell commands memorized. I use the heck out of "help *pw*something*" to find commands related to what i want, and then "help topic -showwindow" to bring up the help in a separate window i can have alongside my code.
Oh yeah, I don't use the ISE so I always forget - if you use the ISE it has tons of help built in, and you can filter commands directly in the pane on the right (or select them by module)