Out-String doesn't work in Universal Dashboard

Out-String doesn't work in Universal Dashboard

Product: PowerShell Universal - Any Version 
Issue:
Out-String does not appear to work in PowerShell Universal Dashboard running in Windows PowerShell v5.1. You will receive empty strings when attempting to use Out-String. See the example below for an example of this issue. 

New-UDDashboard -Title "Hello, World!" -Content {
    $Processes = Get-Process | Out-String
    New-UDCard -Content {
        New-UDElement -tag 'pre' -Content {
            $Processes
        }
    }
}


Resolution:
The Out-String -Width parameter is defaulting to 0 which is causing no output to be shown. Set the -Width parameter to a large value to see output. See the below example for a resolution.

New-UDDashboard -Title "Hello, World!" -Content {
    $Processes = Get-Process | Out-String -Width 10000
    New-UDCard -Content {
        New-UDElement -tag 'pre' -Content {
            $Processes
        }
    }
}

    • Related Articles

    • PowerShell Universal Service crashes on startup after an upgrade to 1.4.6

      Version: PowerShell Universal 1.4.6 Issue The PowerShell Universal service will crash with the following error in Event Viewer.  Application: Universal.Server.exe CoreCLR Version: 4.700.19.56402 .NET Core Version: 3.1.0 Description: The process was ...
    • Dashboard does not start

      Version: PowerShell Universal 2.x Problem: When attempting to start a dashboard, the dashboard either reports Start Failed or does not transition from Stopped.  Root Cause and Resolution: There can be multiple root causes for this issue. Each root ...
    • PowerShell Universal crashes after upgrade to 1.5

      Version: 1.5 Issue: The PowerShell Universal service will not start properly when upgrading from 1.4 to 1.5. The following error is shown in the log.  Unhandled exception. System.InvalidCastException: Unable to cast object of type ...
    • OpenID Connect does not work with HTTP

      Version: Any Problem: When configuring PowerShell Universal OpenID Connect authentication, the server will return a 500 error when attempting to authenticate.  Root Cause Chrome 80 introduced new settings that require cross-site cookies to be secure. ...
    • ERR_HTTP2_INADEQUATE_TRANSPORT_SECURITY when accessing PowerShell Universal

      Version: ​Any Issue: When accessing PowerShell Universal with a Chromium-based browser such as Google Chrome or Microsoft Edge, you can encounter an error when HTTPS is enabled. The error will state ERR_HTTP2_INADEQUATE_TRANSPORT_SECURITY.  Root ...