Skip to content

Instantly share code, notes, and snippets.

@gerane
Created May 13, 2016 14:59
Show Gist options
  • Save gerane/1925324d7ea7e3c767eb45abcde91e8b to your computer and use it in GitHub Desktop.
Save gerane/1925324d7ea7e3c767eb45abcde91e8b to your computer and use it in GitHub Desktop.
function Invoke-TestCommand {
$Extensions = Get-Childitem -path "$Env:USERPROFILE\.vscode-insiders\extensions\gerane*" -Directory
$caption = "Please select a an Extension"
$message = "Package.json will be launched"
[int]$defaultChoice = 0
$Choices = [System.Management.Automation.Host.ChoiceDescription[]] @($Extensions.Name)
$TestParam = $host.ui.PromptForChoice($caption,$message, $choices,$defaultChoice)
$ExtDir = $Extensions[$TestParam].FullName
$Package = Get-ChildItem -path "$ExtDir\package.json"
$psEditor.Workspace.OpenFile($Package)
}
Register-EditorCommand `
-Name "MyModule.OpenExtPackageJson" `
-DisplayName "Open Extension Package.json" `
-Function Invoke-TestCommand
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment