Skip to content

Instantly share code, notes, and snippets.

@brettmillerb
Last active September 28, 2020 12:31
Show Gist options
  • Save brettmillerb/15818a443ed0ad7762d281989ebc1105 to your computer and use it in GitHub Desktop.
Save brettmillerb/15818a443ed0ad7762d281989ebc1105 to your computer and use it in GitHub Desktop.
MacOS Open Pwsh Wrapper
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