Save-VaultFile
Downloads a file from Vault to a local directory.
Syntax
Save-VaultFile -File <String> [-DownloadDirectory <String>] [-Version <VersionGatheringOption>] [-ExcludeChildren] [-NoRecursiveChildren] [-NotOverride] [-IncludeAttachments] [-IncludeHiddenEntities] [-IncludeParents] [-RecursiveParents][-IncludeRelatedDocumentation] [<CommonParameters>]
Parameters
Type |
Name |
Description |
Default value |
Optional |
---|---|---|---|---|
String |
File |
Path to the file, which should be downloaded |
no |
|
String |
DownloadDirectory |
Absolute Path to a local file. If NOT set, it will download the file to the vault workspace. If the target directory doesn’t exist it will be created |
yes |
|
Enum |
Version |
Version of the related files to be downloaded. (Latest, Actual, Revision) |
Latest |
yes |
SwitchParameter |
ExcludeChildren |
Version of the related files to be downloaded. (Latest, Actual, Revision) |
yes |
|
SwitchParameter |
NoRecursiveChildren |
Children of the source file will be excluded |
yes |
|
SwitchParameter |
ExcludeLibaryContents |
Only the first level of children will be included |
yes |
|
SwitchParameter |
NotOverride |
Entities that are a part of a Vault Library will be excluded |
yes |
|
SwitchParameter |
IncludeAttachments |
Folder/Files will not be overwritten, if they already exists |
yes |
|
SwitchParameter |
IncludeHiddenEntities |
Attachments of the file will be included |
yes |
|
SwitchParameter |
IncludeParents |
Parents of the source file will be included |
yes |
|
SwitchParameter |
RecursiveParents |
Parents will be included recursively |
yes |
|
SwitchParameter |
IncludeRelatedDocumentation |
The related documentation of the source file will be included. For example, a DWG might be considered related documentation for an assembly. The DWG is not considered an attachment or a dependent |
yes |
Return type
File[] ← on success
empty <- on failure. Exception/ErrorMessage can be accessed using $Error.
Remarks
The cmdlet downloads a file from the Vault Server to a local directory.
The result of the cmdlet contains a list of all the downloaded files.
Each of those files have an additional property ‘LocalPath’ containing the full path (including the file name) of the downloaded file.
Examples
Download a File
$result = Save-VaultFile -File "$/Designs/Sample/Not.iam" -DownloadDirectory "C:\temp\Vault\Sample\"
$result[0].LocalPath #Returns C:\temp\Vault\Sample\Not.iam
Download a File to the vault workspace including related documentation files
$result = Save-VaultFile -File "$/Designs/Sample/Not.iam" -IncludeRelatedDocumentation