#ProjectWise, #PowerShell, #PowerWiseScripting, PWPS_DAB

HowTo: Navigate to Infrastructure Cloud Project

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 have a simple one today. Lately, I am finding myself needing to navigate to an Infrastructure Cloud project associated with a Work Area. This is simple to do within PowerShell.

First you will need to get the ProjectWise folder object for the desired Work Area.

# Obtain the ProjectWise folder object.
$pwFolder = Show-PWFolderBrowserDialog -DialogTitle 'Select Work Area'

Next, you will need to get the Infrastructure Cloud project Guid. This will be used in an URL to navigate to the Infrastructure Cloud project.

# Obtain the Infrastructure Cloud project guid.
$Guid = [System.Guid]::NewGuid()
if([pwwrapper]::aaApi_GetConnectedProjectAssociation($pwFolder.ProjectID, [ref] $Guid)){
Write-Host $guid.Guid -ForegroundColor Green
} else {
Write-Warning -Message "$([pwwrapper]::aaApi_GetMessageByErrorId([pwwrapper]::aaApi_GetLastErrorId()))"
break
}

Finally, you will simply navigate to the Infrastructure Cloud project.

# Open the web browser and navigate to the specified Infrastructure Cloud project.
explorer "https://infrastructurecloud.bentley.com/$($Guid)/home"

 


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. And thank you for checking out my blog.

Leave a comment

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