Skip to content

Commit

Permalink
✨ feat: Remove-MyItem can rm multiple items at once
Browse files Browse the repository at this point in the history
  • Loading branch information
jacquindev committed Dec 8, 2024
1 parent 09c8171 commit 11bad36
Showing 1 changed file with 6 additions and 13 deletions.
19 changes: 6 additions & 13 deletions dotposh/Config/posh-aliases.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ function Remove-MyItem {
param (
[Parameter(Mandatory = $false)]
[switch]$rf,
[Parameter(Mandatory = $true, Position = 0)]
[string]$Path
[Parameter(Mandatory = $true, Position = 0, ValueFromRemainingArguments = $true)]
[string[]]$Path
)
Remove-Item $Path -Recurse:$rf -Force:$rf
}
Expand All @@ -113,11 +113,6 @@ Set-Alias -Name 'which' -Value 'Get-CommandInfo'
#Remove-Item Alias:rm -Force -ErrorAction SilentlyContinue
Set-Alias -Name 'rm' -Value 'Remove-MyItem'

# lazygit
if (Get-Command lazygit -ErrorAction SilentlyContinue) {
Set-Alias -Name 'lg' -Value 'lazygit'
}

# ----------------------------------------------------------------------------------- #
# We need 'posh-alias' module to add the following aliases.
if (!(Get-Command 'Add-Alias' -ErrorAction SilentlyContinue)) {
Expand All @@ -134,7 +129,7 @@ if (Get-Command eza -ErrorAction SilentlyContinue) {
Add-Alias la "eza $_eza_params -al --time-style=relative --sort=modified"
Add-Alias ld "eza $_eza_params -lDa --show-symlinks" # lists only directories
Add-Alias lf "eza $_eza_params -lfa --show-symlinks" # lists only files (included hidden files)
Add-Alias ll "eza $_eza_params -lbhHigUmuSa" # Lists everything in details of date
Add-Alias ll "eza $_eza_params -lbhHigUmuSa" # Lists everything in details of date
Add-Alias lt "eza $_eza_params -lT" # Tree view of detailed information
Add-Alias tree "eza $_eza_params --tree" # Tree view
}
Expand All @@ -161,17 +156,15 @@ Add-Alias edge 'Start-Process microsoft-edge:'
# Source: - https://stackoverflow.com/questions/11546069/refreshing-restarting-powershell-session-w-out-exiting
if (Test-Path -Path $PROFILE) {
Add-Alias reload '. $PROFILE'
}
else {
} else {
Add-Alias reload '. $PROFILE.CurrentUserAllHosts'
}
Add-Alias restart 'Get-Process -Id $PID | Select-Object -ExpandProperty Path | ForEach-Object { Invoke-Command { & "$_" } -NoNewScope }'

# windows system
if (Get-Command fastfetch -ErrorAction SilentlyContinue) {
Add-Alias sysinfo 'fastfetch -c all'
}
else {
} else {
Add-Alias sysinfo 'Get-ComputerInfo'
}

Expand All @@ -191,4 +184,4 @@ Add-Alias HKCU: 'Set-Location HKCU:'
Add-Alias npm-list '([string]::join(" ", ((npm ls -g --depth=0) | select -skip 1 | select -skiplast 1 | % { $_.remove(0,4) }))).Replace(" ","`r`n")'

# Use VBoxManage without adding it to PATH
# Add-Alias vboxmanage '&"C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" $args'
# Add-Alias vboxmanage '&"C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" $args'

0 comments on commit 11bad36

Please sign in to comment.