#PowerShell, #PowerWiseScripting, #ProjectWise, PWPS_DAB

HowTo: Get ProjectWise Design Integration Version

Be sure to check out my Scripting4Crypto initiative. It’s a fun way to get into using cryptocurrencies all while getting your PowerShell needs met.

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[2].IndexOf('Host')
<# Determine the string length by subtracting the index from the position
    of the word Address in the string. #>
$length = $pwPing[2].IndexOf('Address') - $index
# Parse out host name and trim whitespace.
$PWHost = $pwPing[2].Substring($index, $length).Trim()

# Get Server IP Address.
$index = $pwPing[2].IndexOf('Address')
$length = $pwPing[2].IndexOf('PW Version') - $index
# Parse out host IP Address and trim whitespace.
$PWIPAddress = $pwPing[2].Substring($index, $length).Trim()

# Get ProjectWise Design Integration Application Version.
$index = $pwPing[2].IndexOf('PW Version')
$length = $pwPing[2].IndexOf('AvgTime') - $index
# Parse out PWDI version and trim whitespace.
$PWVersion = $pwPing[2].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.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.