Contents
Updated on 2021-08-26
Having found that the Windows Terminal has gained support for the ANSI Escape sequence documented in the Hyperlinks in Terminal Emulators GIST I wrote a nice and simple PowerShell function to output these hyperlinks without having to remember the escape sequences yourself.
|
|
You can use this like so:
|
|
If you forget to add a Label
then the function will simply print the URL directly, without the formatting sequences.
You can also use this as part of a Write-Output line:
|
|
This should also work in PowerShell on macOS and Linux, too. (Note that it requires PowerShell 7+ for the escape sequences to be sent correctly)