Last active
September 28, 2020 12:31
-
-
Save brettmillerb/15818a443ed0ad7762d281989ebc1105 to your computer and use it in GitHub Desktop.
MacOS Open Pwsh Wrapper
This file contains hidden or 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 Open-NativeApplication { | |
[CmdletBinding()] | |
[Alias('open')] | |
param ( | |
[Parameter()] | |
[ArgumentCompleter( | |
{ | |
param($Command, $Parameter, $WordToComplete, $CommandAst, $FakeBoundParams) | |
(Get-ChildItem /Applications).name -like "$WordToComplete*" | % {"'$_'"} | |
} | |
)] | |
[Alias('a')] | |
$Application | |
) | |
& /usr/bin/open -a $Application | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment