Open-VaultConnection does not work with Windows authentication

The Open-VaultConnection Cmdlet currently does not support authenticating with Windows authentication or Autodesk ID. In order to write scripts or debug code you can log into Vault by opening the Vault login dialog. This will allow you to use the Vault API and powerVault Cmdlets e.g. in a PowerShell ISE. This solution requires user input to pass the credentials.

Solution

Show the Vault login dialog

First you need to import the powerVault module and load the DLL "Autodesk.DataManagement.Client.Framework.Vault.Forms.dll" using Add-Type:

Import-Module powerVault
Add-Type -path "C:\Program Files\Autodesk\Vault <VERSION>\Explorer\Autodesk.DataManagement.Client.Framework.Vault.Forms.dll"
 

After the DLL is imported correctly you can display the Vault login dialog using the following code:

$global:VaultConnection = [Autodesk.DataManagement.Client.Framework.Vault.Forms.Library]::Login($null)
 

using "$VaultConnection.WebServiceManager" you have access to the Vault API. To be able to access it the same way as in powerVault trough the $vault variable you can use the following code:

$global:Vault = $VaultConnection.WebServiceManager