-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Format-Table doesn't work when run on vsts. #6748
Copy link
Copy link
Closed
Labels
Issue-Discussionthe issue may not have a clear classification yet. The issue may generate an RFC or may be reclassifthe issue may not have a clear classification yet. The issue may generate an RFC or may be reclassifResolution-No ActivityIssue has had no activity for 6 months or moreIssue has had no activity for 6 months or moreWG-Cmdlets-Utilitycmdlets in the Microsoft.PowerShell.Utility modulecmdlets in the Microsoft.PowerShell.Utility module
Metadata
Metadata
Assignees
Labels
Issue-Discussionthe issue may not have a clear classification yet. The issue may generate an RFC or may be reclassifthe issue may not have a clear classification yet. The issue may generate an RFC or may be reclassifResolution-No ActivityIssue has had no activity for 6 months or moreIssue has had no activity for 6 months or moreWG-Cmdlets-Utilitycmdlets in the Microsoft.PowerShell.Utility modulecmdlets in the Microsoft.PowerShell.Utility module
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 80But the expected behavior is that Format-Table returns non null results regardless of the environment.
Steps to reproduce
Expected behavior
Actual behavior
$result is null
Environment data