I've installed the GitHub CLI and then attempt to run it but it fails each time.

winget install github.cli
gh
gh brings up GitHub CLI info.
An error is produced

Any other software? No
```
For some reason, it looks like gh isn't available directly in the PATH. It worked for me when I opened a new powershell window.
This is likely do to the session needing reloaded. Basically, it added it, but your current PS session doesn't know about it yet. This is normal (same thing happens in all *nix shells).
That being said, it would be nice if winget automatically refreshed the path. Maybe a flag could be added to the manifest file to trigger this.
Another option would be to provided a command like winget session refresh. This is what Chocolatey does (Update-SessionEnvironment or refreshenv)
@dhrrgn I think that you're correct because when I opened a new PS Core shell today, it worked as expected. I was confused yesterday because I opened a new tab in Windows Terminal after installation and received the same error message. When I opened a new and independent PS Core shell, it worked as expected today.
Regarding what you said about *nix above, if I use dnf or apt to install an application, the application is available for immediate use and doesn't require a new window. Are they doing something akin to what you suggest above?
@dhrrgn is correct, we don't currently reload the session. I'm going to change the title to indicate the feature request.
I ran into a similar problem when trying to install python: winget install python
After the Python installation wizard launched and finished, the tool reported: Successfully installed. But python was not automatically added to my path (reloading the session didn't help here, running $ python in the terminal takes me to the "Get Python" page in the Microsoft Store), though the python.exe was installed to the following location:
C:\Users\<username>\AppData\Local\Programs\Python\Python38
Am I missing a switch when running the install command above?
Regarding what you said about *nix above, if I use
dnforaptto install an application, the application is available for immediate use and doesn't require a new window. Are they doing something akin to what you suggest above?
I'd imagine that's because they are adding symlinks to a location already on the PATH, such as /usr/local/bin, so there is no need to update the PATH.
Actually, I have installed vim, meld and a few other applications _and_ rebooted my computer but still the commands are not available.
Most helpful comment
This is likely do to the session needing reloaded. Basically, it added it, but your current PS session doesn't know about it yet. This is normal (same thing happens in all *nix shells).
That being said, it would be nice if
wingetautomatically refreshed the path. Maybe a flag could be added to the manifest file to trigger this.Another option would be to provided a command like
winget session refresh. This is what Chocolatey does (Update-SessionEnvironmentorrefreshenv)