fslogix icon indicating copy to clipboard operation
fslogix copied to clipboard

[BUG] Remove-ProfileData.ps1 does not calculate deleted sizes properly

Open vadgonzalez opened this issue 4 years ago • 1 comments

Describe the bug A clear and concise description of what the bug is. Remove-ProfileData.ps1 does not calculate deleted sizes properly.

To Reproduce

Steps to reproduce the behavior:

case 1

1 drop 2 files (each one 70+ MB) into one of the folders listed in targets.xml for deletion

(by this time profile is cleaned up so nothing to delete from there except these files)

C:\Users\username\AppData\Local\Microsoft\Windows\WER
2 run script in whatif mode or -confirm:$false mode .\Remove-ProfileData.ps1 -Targets .\targets.xml -verbose -confirm:$false 3. script reports deleted files size = 0.42 MiB

===

VERBOSE: Total file size deleted: 0.42 MiB. VERBOSE: Script took 7945.0875 ms to complete. Deleted: 0.42 MiB.

===

case 2 (file size is reported properly for 1 file in the folder) 1 drop a file into one of the folders listed in targets.xml for deletion (by this tie profile is cleaned up so nothing to delete from there except this file) C:\Users\username\AppData\Local\Microsoft\Windows\WER
2 run script in whatif mode or -confirm:$false mode .\Remove-ProfileData.ps1 -Targets .\targets.xml -verbose -confirm:$false 3. script reports deleted file size correctly .

Expected behavior Script report proper size for deleted files.

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. Windows 10 1709, ]
  • No Fslogix agent installed, testing on persistent Citrix Xen Desktop

vadgonzalez avatar Aug 20 '19 04:08 vadgonzalez

Can't work out what's going on here. If I write the file list to the pipeline and calculate external to the script, I get the right value.

aaronparker avatar Sep 01 '19 12:09 aaronparker