Skip to content

Format-Table doesn't know about $psStyle.FormatHyperlink #16420

@jhoneill

Description

@jhoneill

Prerequisites

Steps to reproduce

Format-Table is able to understand that escape sequences don't print when sizing text (otherwise nothing would align) but it has a blind spot when the sequence is for a URL

dir | ft @{n="link";e={$PSStyle.FormatHyperlink($_.name, ("some random text as a link" + "x" * (random -Max 5) ) )}}, lastwritetime
Will demonstrate it

Expected behavior

link                            LastWriteTime
----                            -------------
6Print                          13/11/2019 10:06:51
archive-vsteam                  13/09/2020 10:57:30
azure-devops-auth-samples       13/11/2019 17:48:16
blog                            25/08/2021 16:45:12
Exiftool                        01/07/2018 11:07:43

Actual behavior

link                                                                        LastWriteTime
----                                                                        -------------
6Print                            13/11/2019 10:06:51
archive-vsteam                    13/09/2020 10:57:30
azure-devops-auth-samples          13/11/2019 17:48:16
blog                            25/08/2021 16:45:12
Exiftool                            01/07/2018 11:07:43


### Error details

_No response_

### Environment data

```powershell
ame                           Value
----                           -----
PSVersion                      7.2.0
PSEdition                      Core
GitCommitId                    7.2.0
OS                             Microsoft Windows 10.0.19043
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Visuals

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue-Questionideally support can be provided via other mechanisms, but sometimes folks do open an issue to get aResolution-FixedThe issue is fixed.WG-Engine-Format

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions