Skip to content

Show-ListView trims leading spaces #1252

@lundebro

Description

@lundebro

Hi,
We're using SPE a lot for validating various content, and we have noticed that Show-ListView seems to trim the values in the cells, which makes it difficult to highlight content that has leading whitespace. By comparison, Format-Table seems to keep the whitespace. See the example below.
We have experimented with replacing whitespace with   which works well enough in the listview control itself, but it doesn't look very nice in the Excel export.
It would be nice if there was a way to prevent the data from being trimmed before being displayed in the listview.

Expected Behavior

Values in Show-ListView cells should include leading whitespace

Actual Behavior

Values in Show-ListView trims leading whitespace

Steps to Reproduce the Problem

$data = [PSCustomObject]@()
$data += [PSCustomObject]@{
  Value = " test"
  Status = "leading whitespace"
}
$data += [PSCustomObject]@{
  Value = "test"
  Status = "valid"
}
$data | Format-Table
$data | Show-ListView
  • Tested issue with clean install of Sitecore and the latest available version of SPE.

  • Asked questions on the Sitecore Slack Chat channel.

  • Reviewed questions and answers on the Sitecore Stack Exchange.

Metadata

Metadata

Assignees

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions