I’ve got a simple one today. In this post, we will use the pwping.exe to determine the ProjectWise Design Integration (PWDI) software version for a specified server. Thanks to Gary Cochrane for pointing this out.
The pwping.exe executable is delivered with the ProjectWise software and is located in the ‘C:\Program Files\Bentley\ProjectWise\bin’ directory.
The pwping utility is used to determine the time and number of hops it takes to get to the PWDI server from the client machine.
Lets first run the command within PowerShell and save the information to a variable.
$pwPing = pwping 'bmf-ws2016-pwdi'
If we look at the object returned, we see that it is an Object of type System.Array and it contains 4 items.
The following shows the contents of each item within the array.
We are only concerned with the 3rd item in the array. We will be parsing out the Host, IP Address and PW Version information.
# Get Host information. Same as server provided. # Get the position of the work Host within the string. $index = $pwPing.IndexOf('Host') <# Determine the string length by subtracting the index from the position of the word Address in the string. #> $length = $pwPing.IndexOf('Address') - $index # Parse out host name and trim whitespace. $PWHost = $pwPing.Substring($index, $length).Trim() # Get Server IP Address. $index = $pwPing.IndexOf('Address') $length = $pwPing.IndexOf('PW Version') - $index # Parse out host IP Address and trim whitespace. $PWIPAddress = $pwPing.Substring($index, $length).Trim() # Get ProjectWise Design Integration Application Version. $index = $pwPing.IndexOf('PW Version') $length = $pwPing.IndexOf('AvgTime') - $index # Parse out PWDI version and trim whitespace. $PWVersion = $pwPing.Substring($index, $length).Trim()
The following shows the results of parsing the data.
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.