PoShPACLI icon indicating copy to clipboard operation
PoShPACLI copied to clipboard

Bugfix: Update Get-PVFileList to fix garbled file list

Open jfurtner opened this issue 1 year ago • 0 comments
trafficstars

Change with v13 of PACLI: FILESLIST adds new column CATEGORYMODIFICATIONDATE, use explicit column list to ensure doesn't break in future

Summary

This PR fixes/implements the following bugs/features:

Bugfix: Update Get-PVFileList to fix garbled file list

Explain the motivation for making this change. What existing problem does the pull request solve?

v13 of PACLI introduced a new column and the files list from Get-PVFileList was garbled

Test Plan

BEFORE:

PS C:\Program Files\WindowsPowerShell\Modules> Get-PVFileList -safe $pmsafe -folder "Root\Policies"
DEBUG: PACLI Command: FILESLIST folder="Root\Policies" safe="PasswordManagerShared" sessionID=45 vault="vault" user="myUSER" OUTPUT (ALL,ENCLOSE)

Filename                          Size                                    Accessed                 LastUsedBy                       LastUsedDate            
--------                          ----                                    --------                 ----------                       ------------            
Policy-CyberArk.ini               5600                                    NO                       Administrator                     Mon Sep 23 21:40:31 2024
--                                PVWAAppUser                             NO                       Sat Sep 21 03:45:36 2024                                 
-1                                Sat Sep 21 03:45:36 2024                47                                                        --                      
PENDING                                                                                            --                               Administrator           
                                  --                                      --                       Administrator                    Wed Dec 30 13:22:41 2020

AFTER:

Z:\PoShPACLI> get-pvfilelist -safe passwordmanagershared -folder 'root\policies' | ft
DEBUG: PACLI Command: FILESLIST folder="root\policies" safe="passwordmanagershared" vault="vault2022m.int.furtner.ca"
user="cyblocaladmin" OUTPUT
(NAME,INTERNALNAME,CREATIONDATE,CREATEDBY,DELETIONDATE,DELETEDBY,LASTUSEDDATE,LASTUSEDBY,SIZE,HISTORY,RETRIEVELOCK,LOCK
DATE,LOCKEDBY,FILEID,DRAFT,ACCESSED,LOCKEDBYGW,VALIDATIONSTATUS,LOCKEDBYUSERID,CATEGORYMODIFICATIONDATE,ENCLOSE)

Filename                                         InternalName    CreationDate             CreatedBy     DeletionDate De
                                                                                                                     le
                                                                                                                     ti
                                                                                                                     on
                                                                                                                     By
--------                                         ------------    ------------             ---------     ------------ --
Policy-CyberArk.ini                              000000000000043 Wed Dec 30 13:22:41 2020 Administrator --
Policy-SAP.ini                                   000000000000044 Wed Dec 30 13:22:41 2020 Administrator --
Policy-WinDomain.ini                             000000000000045 Wed Dec 30 13:22:41 2020 Administrator --
Policy-WinServerLocal.ini                        000000000000046 Wed Dec 30 13:22:41 2020 Administrator --
P

Demonstrate the code is solid. Example: The exact commands you ran and their output.

Closes issues

Fixes # n/a

Code formatting

Ensure your code adheres to the project's PowerShell Styleguide

jfurtner avatar Sep 24 '24 05:09 jfurtner