Compare commits
3 Commits
68b21da5b9
...
125a509240
Author | SHA1 | Date | |
---|---|---|---|
125a509240 | |||
b49371eaa3 | |||
d219cd1479 |
10
alias.ps1
10
alias.ps1
@ -1,5 +1,5 @@
|
|||||||
# Remove these aliases to PowerShell builtins which clobber the actaul exes.
|
# Remove builtin aliases
|
||||||
Remove-Item alias:curl
|
Remove-Item Alias:curl
|
||||||
Remove-Item alias:wget
|
Remove-Item Alias:wget
|
||||||
Remove-Item alias:cd
|
Remove-Item Alias:cd
|
||||||
# TODO: Remove default abbriviation aliases
|
Remove-Item Alias:rm
|
||||||
|
30
utils.ps1
30
utils.ps1
@ -13,4 +13,32 @@ function cd {
|
|||||||
Set-Location -Path $Path
|
Set-Location -Path $Path
|
||||||
}
|
}
|
||||||
|
|
||||||
# TODO: Define rm to work with -rf and multiple entries
|
function rm {
|
||||||
|
Param (
|
||||||
|
[Parameter(
|
||||||
|
Mandatory=$true,
|
||||||
|
ValueFromRemainingArguments=$true
|
||||||
|
)][string[]]$Paths,
|
||||||
|
[switch]$F, [switch]$Force,
|
||||||
|
[switch]$R, [switch]$Recurse,
|
||||||
|
[switch]$RF, [switch]$FR
|
||||||
|
)
|
||||||
|
$Command = "Remove-Item"
|
||||||
|
if ($F -or $Force -or $RF -or $FR) {
|
||||||
|
$Command = "$Command -Force"
|
||||||
|
}
|
||||||
|
if ($R -or $Recurse -or $RF -or $FR) {
|
||||||
|
$Command = "$Command -Recurse"
|
||||||
|
}
|
||||||
|
foreach ($Path in $Paths) {
|
||||||
|
Invoke-Expression -Command "$Command $Path"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# Add new aliases
|
||||||
|
function touch {
|
||||||
|
Param (
|
||||||
|
[string]$Path
|
||||||
|
)
|
||||||
|
New-Item -Type File $Path
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user