From c1b4b3933bedeeda0609ab1396679bfb1dfda8d4 Mon Sep 17 00:00:00 2001 From: theflyingfool Date: Sun, 9 Jun 2024 17:48:29 -0500 Subject: [PATCH] Update windows/Microsoft.PowerShell_profile.ps1 added PS equivalent of dot alias --- windows/Microsoft.PowerShell_profile.ps1 | 31 ++++++++++++++---------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/windows/Microsoft.PowerShell_profile.ps1 b/windows/Microsoft.PowerShell_profile.ps1 index 994ba8f..29b1b73 100644 --- a/windows/Microsoft.PowerShell_profile.ps1 +++ b/windows/Microsoft.PowerShell_profile.ps1 @@ -1,14 +1,19 @@ -Register-ArgumentCompleter -Native -CommandName winget -ScriptBlock { - param($wordToComplete, $commandAst, $cursorPosition) - [Console]::InputEncoding = [Console]::OutputEncoding = $OutputEncoding = [System.Text.Utf8Encoding]::new() - $Local:word = $wordToComplete.Replace('"', '""') - $Local:ast = $commandAst.ToString().Replace('"', '""') - winget complete --word="$Local:word" --commandline "$Local:ast" --position $cursorPosition | ForEach-Object { - [System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterValue', $_) - } - } - - -function touch($file) { - "" | Out-File $file -Encoding ASCII +Register-ArgumentCompleter -Native -CommandName winget -ScriptBlock { + param($wordToComplete, $commandAst, $cursorPosition) + [Console]::InputEncoding = [Console]::OutputEncoding = $OutputEncoding = [System.Text.Utf8Encoding]::new() + $Local:word = $wordToComplete.Replace('"', '""') + $Local:ast = $commandAst.ToString().Replace('"', '""') + winget complete --word="$Local:word" --commandline "$Local:ast" --position $cursorPosition | ForEach-Object { + [System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterValue', $_) + } + } + + +function touch($file) { + "" | Out-File $file -Encoding ASCII +} + +function dot { + param([string[]]$args) + & git --git-dir=$env:USERPROFILE\.dot --work-tree=$env:USERPROFILE $args } \ No newline at end of file