Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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