This repository provides a small PowerShell-based helper for discovering ProjectWise cloud projects that are connected to ProjectWise Drive and allowing a user to select and sync them to their local machine.
The solution combines:
- PowerShell logic to query Bentley/ProjectWise project metadata
- a WPF selection window for choosing projects
- a local metadata/sync endpoint contract used by the desktop sync service
It is intended for environments where ProjectWise Drive sync is available and a local service is exposing project metadata and sync endpoints at http://localhost:5000.
The scripts will:
- query the current user's connected cloud projects
- check whether each project has a work area connection and Drive enabled
- filter out projects that are not eligible for sync
- show a selectable list of valid projects in a desktop window
- submit sync requests for the selected projects
- persist the selected project IDs to a local state file
This is the main script. It contains the core logic for:
- obtaining an OIDC/Bentley token
- enumerating ProjectWise cloud projects from the Bentley API
- detecting whether a project has a Drive-enabled work area connection
- displaying a WPF selection window
- syncing selected projects through the local
SyncProjectendpoint - saving project selections to a JSON state file
It can be run with or without showing the UI.
This is a lightweight helper script that lists connected cloud projects and can optionally filter to only projects that are not already synced.
It is useful for quick checks and troubleshooting without launching the full UI.
This is the XAML definition for the WPF window used by the main PowerShell script. It defines the project filter box, selection list, sync button, and controls for selecting and clearing project selections.
Before using the scripts, ensure the following are available:
- Windows PowerShell or PowerShell 7+
- access to a Bentley/ProjectWise environment with valid authentication
- the proper Bentley PowerShell modules available in the session, including
Get-OIDCToken - a local metadata endpoint available on
http://localhost:5000/metadata - a local sync endpoint available on
http://localhost:5000/SyncProject - the current user is signed in to ProjectWise so an OIDC token can be acquired
The code specifically looks for token commands such as:
Get-OIDCTokenpwps_dab\Get-OIDCToken
The scripts accept a few parameters:
-MetadataUrldefault:http://localhost:5000/metadata-ProjectStateFileoptional path to a JSON state file; defaults tobackupPWDProjects.jsonin the script folder-ShowWindowopens the project selector UI
Example:
.\ATRL_PWDriveProjectSelector.ps1 -ShowWindow-MetadataUrldefault:http://localhost:5000/metadata-ProjectStateFileoptional path to the saved project list-OnlyNotSyncedshows only projects that are not already synced
Examples:
.\ATRL_GetConnectedCloudProjects.ps1
.\ATRL_GetConnectedCloudProjects.ps1 -OnlyNotSynced-
Sign in to the appropriate Bentley/ProjectWise account.
-
Launch the selector UI:
.\ATRL_PWDriveProjectSelector.ps1 -ShowWindow -
Review the list of valid connected projects with ProjectWise Drive enabled.
-
Filter or select the projects to sync.
-
Click the sync button.
-
The script submits the selected project IDs to the local sync endpoint and stores them in the local JSON state file.
- Only projects with an active work area connection and Drive-enabled status are included.
- The UI supports selection of up to 80 projects per sync batch.
- The selection state is saved to a JSON file so previously saved projects can be tracked.
- The script flags projects as synced based on metadata returned from the local
metadataservice.
- This helper depends on an external metadata/sync service running locally on port 5000.
- If no valid Bentley token is available, the scripts will fail with a clear message instructing the user to sign in or ensure the required PowerShell module is available.
- The sync request is limited to 80 projects at a time by design, matching the Desktop Connector UI constraint.
This project is provided as-is for internal or team use within the ProjectWise Drive sync workflow. Update or extend the script as needed for your environment.