Update ContentLibrary.psm1
Adding logic incase backing isn't a datastore.
This commit is contained in:
@@ -198,8 +198,14 @@ Function Get-ContentLibraryItemFiles {
|
|||||||
$contentLibraryItemStorageService = Get-CisService com.vmware.content.library.item.storage
|
$contentLibraryItemStorageService = Get-CisService com.vmware.content.library.item.storage
|
||||||
|
|
||||||
foreach($file in $files) {
|
foreach($file in $files) {
|
||||||
$filepath = $contentLibraryItemStorageService.get($itemId, $($file.name)).storage_uris.AbsolutePath.split("/")[5..7] -join "/"
|
if($contentLibraryItemStorageService.get($itemId, $($file.name)).storage_backing.type -eq "DATASTORE"){
|
||||||
$fullfilepath = "[$($datastore.name)] $filepath"
|
$filepath = $contentLibraryItemStorageService.get($itemId, $($file.name)).storage_uris.AbsolutePath.split("/")[5..7] -join "/"
|
||||||
|
$fullfilepath = "[$($datastore.name)] $filepath"
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$fullfilepath = "UNKNOWN"
|
||||||
|
}
|
||||||
|
|
||||||
if(!$LibraryItemName) {
|
if(!$LibraryItemName) {
|
||||||
$fileResult = [pscustomobject] @{
|
$fileResult = [pscustomobject] @{
|
||||||
Name = $file.name;
|
Name = $file.name;
|
||||||
|
|||||||
Reference in New Issue
Block a user