diff --git a/windows/Microsoft.PowerShell_profile.ps1 b/windows/Microsoft.PowerShell_profile.ps1 new file mode 100644 index 0000000..994ba8f --- /dev/null +++ b/windows/Microsoft.PowerShell_profile.ps1 @@ -0,0 +1,14 @@ +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 +} \ No newline at end of file diff --git a/windows/Microsoft.VSCode_profile.ps1 b/windows/Microsoft.VSCode_profile.ps1 new file mode 100644 index 0000000..b841b2d --- /dev/null +++ b/windows/Microsoft.VSCode_profile.ps1 @@ -0,0 +1,9 @@ +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', $_) + } + }