Invoke-Obliteration
1.0.1
This function deletes one or more files or folders recursively, including its files and sub-directories.
It was also designed to accept input from the pipeline, from Cmdlets like 'Get-ChildItem'.
If one of the file system objects are open in another process it attempts to close the handles.
The closing handle mechanism was ported from the 'WindowsUtils' module.
ATTEN
It was also designed to accept input from the pipeline, from Cmdlets like 'Get-ChildItem'.
If one of the file system objects are open in another process it attempts to close the handles.
The closing handle mechanism was ported from the 'WindowsUtils' module.
ATTEN
This function deletes one or more files or folders recursively, including its files and sub-directories.
It was also designed to accept input from the pipeline, from Cmdlets like 'Get-ChildItem'.
If one of the file system objects are open in another process it attempts to close the handles.
The closing handle mechanism was ported from the 'WindowsUtils' module.
ATTENTION!!!
This function deletes files and potentially closes open handles without prompting for confirmation!
It was designed to be like that.
Closing other processe's handles to a file system object may cause system malfunction. Use it with care!
About privileges:
The main API tries to enable the 'SeBackupPrivilege' and 'SeRestorePrivilege' for the executing process token during execution to make sure we have the right permissions.
These privileges are disabled once the method ends.
About cancellation:
The main API implements a cancellation handler to capture 'Ctrl-C' and 'Ctrl-Break' commands.
All the internal APIs were designed with cooperative multitasking in mind, so if you press a cancellation combination the operation stops.
Due some bugs I found with Windows PowerShell I couldn't remove the handler at the end of execution because it breaks the console.
Although the handle continues registered it does nothing if it's not in the method execution 'context'.
Show more
It was also designed to accept input from the pipeline, from Cmdlets like 'Get-ChildItem'.
If one of the file system objects are open in another process it attempts to close the handles.
The closing handle mechanism was ported from the 'WindowsUtils' module.
ATTENTION!!!
This function deletes files and potentially closes open handles without prompting for confirmation!
It was designed to be like that.
Closing other processe's handles to a file system object may cause system malfunction. Use it with care!
About privileges:
The main API tries to enable the 'SeBackupPrivilege' and 'SeRestorePrivilege' for the executing process token during execution to make sure we have the right permissions.
These privileges are disabled once the method ends.
About cancellation:
The main API implements a cancellation handler to capture 'Ctrl-C' and 'Ctrl-Break' commands.
All the internal APIs were designed with cooperative multitasking in mind, so if you press a cancellation combination the operation stops.
Due some bugs I found with Windows PowerShell I couldn't remove the handler at the end of execution because it breaks the console.
Although the handle continues registered it does nothing if it's not in the method execution 'context'.
Installation Options
Owners
Package Details
Author(s)
- francisconabas@outlook.com
Tags
Remove Delete Files Folders PowerShell Microsoft Windows Explorer
Dependencies
This script has no dependencies.
Release Notes
Version 1.0.1:
- Native array enumeration optimization.
- Consolidated folder and file delete in single method.
- Fixed bug on progress data.
- Fixed bug on closed handle warning.
- New monitoring mechanism.
- Changes on the C# code to conform to C# 5, because Windows PowerShell thinks it's 2012.
Version 1.0.0:
- Initial version published.
FileList
- Invoke-Obliteration.nuspec
- Invoke-Obliteration.ps1
Version History
Version | Downloads | Last updated |
---|---|---|
1.0.2 | 14 | 10/28/2024 |
1.0.1 (current version) | 134 | 10/12/2024 |
1.0.0 | 6 | 10/11/2024 |