From ef393be38d0e70ee02dba2d5a76db72a9f61e65f Mon Sep 17 00:00:00 2001 From: theflyingfool Date: Sun, 9 Jun 2024 17:47:44 -0500 Subject: [PATCH] Upload files to "windows" Added Powershell profile --- windows/Microsoft.PowerShell_profile.ps1 | 14 ++++++++++++++ windows/Microsoft.VSCode_profile.ps1 | 9 +++++++++ 2 files changed, 23 insertions(+) create mode 100644 windows/Microsoft.PowerShell_profile.ps1 create mode 100644 windows/Microsoft.VSCode_profile.ps1 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', $_) + } + }