Getting started

../_images/powervault_console.png

Start the powershell environment

In order to get started either open any powershell IDE and load the powerVault Module by calling Import-Module powerVault or open the powerVault Console shortcut in the start menu, which already loads powerVault for you.

Connect to Vault (optional)

To use the powerVault Cmdlet’s a Vault connections is required.
In Vault Application or Vaullt Extensions (such as Data Standard Customizations), the Cmdlet’s automatically detect and reuse the application’s latest Vault connection.

However, in Powershell IDE’s where a Vault connection does not already exist, the Open-VaultConnection cmdlet can be used to create a new connection, passing the required credentials.

Get a file from Vault

With the Vault Connection available, you can start working with powerVault.
Lets search for a random file which was created by the connected user:

$user = $vaultConnection.UserName
$file = Get-VaultFile -Properties @{"Created By"=$user}

Examine the file

To check which properties our file has, we have two options.
Either we simply let the powershell Host print the $file object or we use the Variableinspector by calling the Show-Inspector Commandlet.

Show-Inspector -Highlight 'file'
../_images/variableinspector1.png

Update the file

In case you want to update the file you can achieve this with the Update-VaultFile Commandlet.
In this example we add an attachement to the file:

$attachment = Get-VaultFile -Properties @{'File Extension'='dwf'} #Search for a .dwf file
$updatedFile = Update-VaultFile -File $file.'Full Path' -Attachments @($attachment.'Full Path') -Comment "Set attachment"

Download the file

You may want to download the file from Vault. For ths operation you can use the Save-VaultFile Commandlet.
In this example we download the file with the recently added attachement:

$downloadedFiles = Save-VaultFile -File $updatedFile.'Full Path' -IncludeAttachments -DownloadDirectory "C:\Temp\Vault\Sample"

$downloadedFiles | select {$_.LocalPath}
#C:\Temp\Vault\Sample\Designs\InventorTestPE.ipt
#C:\Temp\Vault\Sample\InventorTestPE.dwf