Retrieves a file from Vault.
It can also be used to download a file to a local directory.

Get-VaultFile [-File <String>] [-FileId <Long>] [-Properties <Hashtable>] [-DownloadPath <String>] [<CommonParameters>]

Type Name Description Optional
String File Absolute vault path to a fileyes
Long FileId Id or MasterId of a vault fileyes
Hashtable Properties This will give you a file with matching propertiesyes
String DownloadPath This is the location where the file and all it's references will be downloadedyes

File ← on success
empty ← on failure

If multiple files are possible the function returns the first file found. In case you want to get multiple files use Get-VaultFiles.

$file = Get-VaultFile -properties @{"Description" = "TEMPLATE"; "Part Number" = "Dial"}
$file = Get-VaultFile -File '$/PowerVaultTestFiles/pV_6.idw'

Downloading the file

$file = Get-VaultFile -File '$/Assemblies/Catch Assembly.iam' -DownloadPath "C:\Temp\TestDownload"
If the directory “C:\Temp\TestDownload” does not exist, it will be created.

Attention: This does not mean that the file 'Catch Assembly.iam' is located directly under “C:\Temp\TestDownload” When downloading the file, you have to remember that the file, and all it's references will be downloaded into this directory. The goal of this functionality is, that the file can be opened without problems out from here. The folder structure of the files in Vault is maintained, and they will not be renamed. To retrieve the location of where the main file was downloaded, you can use the additional property: $file.LocalPath

For additional download options use the Save-Vaultfile cmdlet.