Please excuse a simple question from a powerVault noob. I would like to list all files in a folder hierarchy, that is, include all the files within sub-folders of a top-level folder. The powerVault documentation at https://blog.coolorange.com/2015/05/01/powervault-in-action/ suggest that get-VaultFiles cmdlet does exactly that:
"If the –Folder argument is omitted, the search goes over the whole Vault, if the –Folder is set, the search is limited to that folder and sub folders."
However, powerVault seems to only return the files in the top level folder when I use that cmdlet, e.g. using :
$files = Get-VaultFiles -Folder "$/Projects/Project A"
$files | format-table "Part Number", "Description", "Revision"
Am I missing something obvious, please? Thanks for any advice.
powerVault Version: powerVault20.0_Vault2019
Vault version : Vault Professional 2019.1.1
I just tested and i am experiencing the same behavior. The official Get-VaultFiles documentation can be found on the coolOrange wiki and contains no information about recursion. I found a Feature Request for this and have added this forum post to it so a message will be posted here when this will be implemented.
You could use the Vault search to get the required files.
Another possibility could be to get all Folders using the API and do a Get-VaultFiles for every folder.
This gets all the ids of subfolders from a parent folder
$allFolderIds = $vault.DocumentService.GetFolderIdsByParentIds(ParentFolderId, $true)
With the ids you can get the paths using FullName
$allPaths = $vault.DocumentService.GetFolderById($folderId).FullName
then for each path you can execute Get-VaultFiles e.g. in a foreach loop.
Thanks for the quick response, Manuel. Nice solutions.