From 9771a5a31f9053aed7cedc2326cf6ecc69415d2b Mon Sep 17 00:00:00 2001 From: Jamie Furtner Date: Mon, 23 Sep 2024 23:07:18 -0600 Subject: [PATCH 1/2] Bugfix: Update Get-PVFileList to fix garbled file list Change with v13 of PACLI: FILESLIST adds new column CATEGORYMODIFICATIONDATE, use explicit column list to ensure doesn't break in future --- PoShPACLI/Functions/FoldersFiles/Get-PVFileList.ps1 | 10 +++++++--- Tests/Get-PVFileList.Tests.ps1 | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) 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 } } From 4d0e87a081b1205be2ac77668f71d7602efaf4ac Mon Sep 17 00:00:00 2001 From: jfurtner <1195789+jfurtner@users.noreply.github.com> Date: Fri, 12 Sep 2025 23:19:29 +0000 Subject: [PATCH 2/2] Update CHANGELOG.md --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) 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`