Skip to content

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

Closed

Description

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

Activity

  1. added
    Needs-Triage
    on Nov 10, 2021
  2. added
    Issue-Question
    on Nov 10, 2021
  3. vexx32 commented on Nov 10, 2021

    @vexx32
    Collaborator

    /cc Steve Lee (@SteveL-MSFT) I believe has done some work around this in the past, might be able to offer some pointers.

  4. ghost added
    In-PR
    on May 25, 2022
  5. ghost removed
    Needs-Triage
    on Jun 8, 2022
  6. ghost removed
    In-PR
    on Jun 8, 2022
  7. ghost added
    Resolution-Fixed
    on Jun 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue-QuestionResolution-FixedWG-Engine-Format

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions