-
-
Save jcwillox/a9b480f8d180d44368e7df2eb7009207 to your computer and use it in GitHub Desktop.
Very nice job! Very helpful. Appreciate your effort.
Hi @jcwillox, thank you for this utility. I have now reinstalled my JetBrains tools using the Jetbrains Toolbox and am using this utility to add the entries to the context menu via the default method.
However, when trying to add the context menu entries using the Nircmd method, I am receiving this error when running the command:
➜ .\toolbox-context-menu.ps1 rider -UseNircmd -Force
Adding Context Menu for 'JetBrains Rider'
ACTION: Edit with JetBrains Rider (Files)
Join-Path : A positional parameter cannot be found that accepts argument '.shellLink'.
At C:\Users\Harry\AppData\Local\JetBrains\Toolbox\scripts\toolbox-context-menu.ps1:123 char:32
+ ... = Get-Content (Join-Path (Split-Path $ExePath) "../.." ".shellLink")
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [Join-Path], ParameterBindingException
+ FullyQualifiedErrorId : PositionalParameterNotFound,Microsoft.PowerShell.Commands.JoinPathCommand
Any ideas how this can be resolved?
Cheers!
Thanks! Pretty sure you just need to enable "shell scripts" in toolbox's settings and provide toolbox a location to put the shell scripts.
Hey, just thought I would put an updated comment on. Used the default method today and worked like a charm, found the dirs and applications and added / removed them super easy. Cheers!
Forgot to update the instructions comment at the top for toolbox 2.0, but better late than never, you can just use the direct install method now.
https://gist.github.com/jcwillox/a9b480f8d180d44368e7df2eb7009207?permalink_comment_id=4037552#gistcomment-4037552
I think I need a little more context/guidance for this one. First, the installation instructions needed an explicit parameter in modern pwsh:
❌
iwr https://gist.github.com/jcwillox/a9b480f8d180d44368e7df2eb7009207/raw/toolbox-context-menu.ps1 -o toolbox-context-menu.ps1
Invoke-WebRequest: Parameter cannot be processed because the parameter name 'o' is ambiguous. Possible matches include: -OperationTimeoutSeconds -OutFile -OutVariable -OutBuffer.
👇
✅
iwr https://gist.github.com/jcwillox/a9b480f8d180d44368e7df2eb7009207/raw/toolbox-context-menu.ps1 -OutFile toolbox-context-menu.ps1
Now, how exactly do I use it?
No matter the parameters, I get an error:
pwsh> .\toolbox-context-menu.ps1 webstorm
WARNING: no channels found in 'C:\Users\josch\AppData\Local\JetBrains\Toolbox\apps\Datalore'
WARNING: no channels found in 'C:\Users\josch\AppData\Local\JetBrains\Toolbox\apps\JetBrainsGateway'
Exception: D:\projects\toolbox-context-menu.ps1:101
Line |
101 | $binPath = Join-Path $versionPath "bin"
| ~~~~~~~~~~~~
| Cannot bind argument to parameter 'Path' because it is null.
Yep thanks, the download command is broken in my terminal now too, pretty bad of them to break that in a minor update, but anyhow, I've updated the download command.
That comment provides the usage instructions too, and it looks like you're not running the correct command, for toolbox v2, you should use something like this
.\toolbox-context-menu.ps1 -AppDir "C:\Users\%USERNAME%\AppData\Local\Programs\PyCharm Professional"
I've added the channel selection functionality, and also added the
DefaultChannel
parameter so you can set a default channel to use and skip the selection prompt if it's found. So, hopefully, it should now be working for everyone.