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

Ensure VM-Remove-DesktopFiles deletes as many files as possible #754

Merged
merged 2 commits into from
Dec 12, 2023

Conversation

Ana06
Copy link
Member

@Ana06 Ana06 commented Nov 24, 2023

I tried to add the deleting of PS_Transcripts in 4ce4958. But we can't delete PS_Transcripts while Powershell is open and VM-Remove-DesktopFiles/VM-Clean-Up are PowerShell functions. I have open #755 to discuss if there is another way to achieve this.

This has reveled another important issue: We set $ErrorActionPreference = 'Stop' at the beginning of the file,
causing that a problem removing an item automatically stops without deleting other files in VM-Remove-DesktopFiles (called fromVM-Clean-Up). We want to ensure the catch in this function is used deleting as many files as possible. Fix this here using -ErrorAction Continue. I also think this may be a more general issue we should discuss in #753

This reverts commit 4ce4958.
We can't delete PS_Transcripts while Powershell is open and
`VM-Clean-Up` is a PowerShell function.
We set `$ErrorActionPreference = 'Stop'` at the beginning of the file,
causing that a problem removing an item automatically stops without
deleting other files in `VM-Remove-DesktopFiles` (called from
`VM-Clean-Up`). We want to ensure the `catch` in this function is used
deleting as many files as possible.
@Ana06 Ana06 merged commit 8053442 into mandiant:main Dec 12, 2023
4 checks passed
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