diff --git a/CHANGELOG.md b/CHANGELOG.md index 00a2693..dedeb42 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,9 @@ All notable changes to this project will be documented in this file. +## [2.1.27.1] - 2025-09-12 +- Bugfix for `Get-PVFileList` with PACLI > v13 + ## [2.1.27] - 2020-04-01 - `Set-PVSafe` diff --git a/PoShPACLI/Functions/FoldersFiles/Get-PVFileList.ps1 b/PoShPACLI/Functions/FoldersFiles/Get-PVFileList.ps1 index 258c207..8e2c4a5 100644 --- a/PoShPACLI/Functions/FoldersFiles/Get-PVFileList.ps1 +++ b/PoShPACLI/Functions/FoldersFiles/Get-PVFileList.ps1 @@ -42,7 +42,10 @@ PROCESS { #execute pacli - $Return = Invoke-PACLICommand $Script:PV.ClientPath FILESLIST "$($PSBoundParameters | ConvertTo-ParameterString) OUTPUT (ALL,ENCLOSE)" + # new column CATEGORYMODIFICATIONDATE returned in v13.x + # Add explicit column list to avoid breaking in the future + $Return = Invoke-PACLICommand $Script:PV.ClientPath FILESLIST ("$($PSBoundParameters | ConvertTo-ParameterString) " + + "OUTPUT (NAME,INTERNALNAME,CREATIONDATE,CREATEDBY,DELETIONDATE,DELETEDBY,LASTUSEDDATE,LASTUSEDBY,SIZE,HISTORY,RETRIEVELOCK,LOCKDATE,LOCKEDBY,FILEID,DRAFT,ACCESSED,LOCKEDBYGW,VALIDATIONSTATUS,LOCKEDBYUSERID,CATEGORYMODIFICATIONDATE,ENCLOSE)") if ($Return.ExitCode -eq 0) { @@ -53,10 +56,10 @@ $Results = $Return.StdOut | ConvertFrom-PacliOutput #loop through results - For ($i = 0 ; $i -lt $Results.length ; $i += 19) { + For ($i = 0 ; $i -lt $Results.length ; $i += 20) { #Get Range from array - $values = $Results[$i..($i + 19)] + $values = $Results[$i..($i + 20)] #Output Object [PSCustomObject] @{ @@ -80,6 +83,7 @@ "LockedByGW" = $values[16] "ValidationStatus" = $values[17] "LockedByUserID" = $values[18] + "CategoryModificationDate" = $values[19] "Safename" = $safe "Folder" = $folder diff --git a/Tests/Get-PVFileList.Tests.ps1 b/Tests/Get-PVFileList.Tests.ps1 index 32736c4..447f0e1 100644 --- a/Tests/Get-PVFileList.Tests.ps1 +++ b/Tests/Get-PVFileList.Tests.ps1 @@ -48,7 +48,7 @@ Describe $FunctionName { Mock Invoke-PACLICommand -MockWith { [PSCustomObject]@{ - StdOut = $((((1..19) * 7 -join '" "') -replace '^', '"') -replace '$', '"') + StdOut = $((((1..20) * 7 -join '" "') -replace '^', '"') -replace '$', '"') ExitCode = 0 } }