Created
August 9, 2024 01:42
-
-
Save kebman/2dfdf28fde92487e449871df2daddb3d to your computer and use it in GitHub Desktop.
My profile for Windows PowerShell, including an UX-like `touch` function
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function home { set-location "~" } | |
Set-Alias vim nvim | |
# Create a command similar to Linux `touch` | |
function touch { | |
Param( | |
[Parameter(Mandatory=$true)] | |
[string]$Path | |
) | |
if (Test-Path -LiteralPath $Path) { | |
(Get-Item -Path $Path).LastWriteTime = Get-Date | |
} else { | |
New-Item -Type File -Path $Path | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I've also set up aliases for common project folders and the current project folder with the template
function proj { Set-Location "~\projects" }
orfunction current { Set-Location "~\Dropbox\projects\how-to-conquer-the-world" }