Skip to content

Instantly share code, notes, and snippets.

@mika76
Last active July 11, 2023 10:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mika76/eab91dc0a569a87a5e8ad763dc938840 to your computer and use it in GitHub Desktop.
Save mika76/eab91dc0a569a87a5e8ad763dc938840 to your computer and use it in GitHub Desktop.
C:\Users\name\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1
# Delete all bin and obj folders recursively
function del-obj-bin {
Param ([string]$Path = ".\")
$title = 'Delete all nested obj and bin folders'
$question = 'Are you sure you want to proceed?'
$choices = '&Yes', '&No'
$decision = $Host.UI.PromptForChoice($title, $question, $choices, 1)
if ($decision -eq 0) {
Get-ChildItem $Path -include bin,obj -Recurse | foreach ($_) { remove-item $_.fullname -Force -Recurse }
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment