Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix: Update Get-PVFileList to fix garbled file list #77

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jfurtner
Copy link

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

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

👍

Copy link

@colorimeter colorimeter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

works well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants