Skip to content

Format-Table doesn't work when run on vsts. #6748

Closed

Description

@kalgiz

Format-Table returns null when run on vsts. The possible reason is that it tries to adjust table to the console dimensions and some parameters of the console like e.g. width might not be set on vsts. In this case the width of the Format-Table results should be set to some default value e.g. 80.

The workaround for that is using Out-String -Width e.g.:
$result = Format-Table -inputobject @{'test'= 1, 2} | Out-String -Width 80

But the expected behavior is that Format-Table returns non null results regardless of the environment.

Steps to reproduce

$result = Format-Table -inputobject @{'test'= 1, 2}

Expected behavior

Name                           Value
----                           -----
test                           {1, 2}

Actual behavior

$result is null

Environment data

> $PSVersionTable

Name                           Value
----                           -----
PSVersion                      6.1.0-preview.1
PSEdition                      Core
GitCommitId                    v6.1.0-preview.1
OS                             Linux 4.9.87-linuxkit-aufs #1 SMP Wed Mar 14 15:12:16 UTC 2018
Platform                       Unix
PSCompatibleVersions           {...}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Activity

  1. iSazonov commented on Apr 27, 2018

    @iSazonov
    Collaborator

    Internally we use 120 console width default.

  2. iSazonov commented on Apr 27, 2018

    @iSazonov
    Collaborator

    Is this a regression? Since 6.0.0?

  3. added
    Issue-Discussion
    on Apr 27, 2018
  4. SteveL-MSFT commented on Apr 27, 2018

    @SteveL-MSFT
    Member

    As Ilya (@iSazonov) noted, we default to 120 width if PowerShell isn't able to read the console width, so we should debug this to understand why it's failing.

  5. microsoft-github-policy-service commented on Nov 16, 2023

    @microsoft-github-policy-service
    Contributor

    This issue has not had any activity in 6 months, if this is a bug please try to reproduce on the latest version of PowerShell and reopen a new issue and reference this issue if this is still a blocker for you.

  6. microsoft-github-policy-service commented on Nov 16, 2023

    @microsoft-github-policy-service
    Contributor

    This issue has not had any activity in 6 months, if this is a bug please try to reproduce on the latest version of PowerShell and reopen a new issue and reference this issue if this is still a blocker for you.

  7. added
    Resolution-No Activity
    on Nov 16, 2023
  8. microsoft-github-policy-service commented on Nov 23, 2023

    @microsoft-github-policy-service
    Contributor

    This issue has been marked as "No Activity" as there has been no activity for 6 months. It has been closed for housekeeping purposes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Issue-DiscussionResolution-No ActivityWG-Cmdlets

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions