Skip to content

Instantly share code, notes, and snippets.

@kebman
Created August 9, 2024 01:42
Show Gist options
  • Save kebman/2dfdf28fde92487e449871df2daddb3d to your computer and use it in GitHub Desktop.
Save kebman/2dfdf28fde92487e449871df2daddb3d to your computer and use it in GitHub Desktop.
My profile for Windows PowerShell, including an UX-like `touch` function
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
}
}
@kebman
Copy link
Author

kebman commented Aug 9, 2024

I've also set up aliases for common project folders and the current project folder with the template function proj { Set-Location "~\projects" } or function current { Set-Location "~\Dropbox\projects\how-to-conquer-the-world" }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment