question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Out-GridView not working as expected on PowerShell 7

See original GitHub issue

There is a script which retrieves some information from a database and returns values on console. When I run this script to fetch information and pipe it to Out-GridView it works just fine on PowerShell 5.1.18362.145.

I installed PowerShell 7 (7.0.0-preview.4) and installed Graphical tools (Microsoft.PowerShell.GraphicalTools)from Powershell Gallery, It is now able to return the value fine on console but when it is piped to Out-GridView, It throws exception.

Steps to reproduce


./Script-Name -ComputerName Server1.domail.com | Out-GridView

Expected behavior

Output on console with PowerShell 5.1, Works for Out-GridView too,
system.hostname : Server1.domain.com
owner Name      : PRAKASH KUMAR
owner Email     : prakash@email.com
os_family       : windows
os_version      : 2012R2
platform        : vmware
Status          : Running
Added at        : Mar 20, 2017 11:10:23
landscape       : Dev
purpose         : testing
stability_zone  : 2


Console Output on PowerShell 7, Not Working on Out-GridView

system.hostname : Server1.domain.com
owner Name      : PRAKASH KUMAR
owner Email     : prakash@email.com
os_family       : windows
os_version      : 2012R2
Platform        : vmware
Status          : Running
Added at        : Mar 20, 2017 11:10:23
landscape       : Dev
purpose         : testing
stability_zone  : 2

Actual behavior

Exception while executing with Out-GridView

ogv : At line:1 char:10
+ $_.owner Name
+          ~~~~
Unexpected token 'Name' in expression or statement.
At line:1 char:64
+ .\ITC-Query.ps1 -ComputerName or1010050152190.corp.adobe.com  |ogv
+                                                                ~~~
+ CategoryInfo          : ParserError: (:) [Out-GridView], ParseException
+ FullyQualifiedErrorId : UnexpectedToken,OutGridView.Cmdlet.OutGridViewCmdletCommand

PS C:\Work\Working>

Environment data

Not Working for Out-GridView
Name                           Value
----                           -----
PSVersion                      7.0.0-preview.4
PSEdition                      Core
GitCommitId                    7.0.0-preview.4
OS                             Microsoft Windows 10.0.18362
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0


Working for Out-GridView
Name                           Value
----                           -----
PSVersion                      5.1.18362.145
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.18362.145
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:9 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
TylerLeonhardtcommented, Sep 23, 2019

@MaximoTrinidad thanks for the cc - yeah if this is truly an issue with GraphicalTools, open an issue here: https://github.com/PowerShell/GraphicalTools (thanks @kilasuit!)

@MaximoTrinidad as for WSL support… not quite sure what that’d look like. I guess if we can detect we’re in WSL, we can launch the Windows version of GraphicalTools which is suppose to work from within WSL, but I’m really note sure. Open a feature request. I don’t have time to add such a feature… but hacktoberfest is around the corner if you’re interested 😃

<div> GitHub</div><div>PowerShell/GraphicalTools</div><div>A module that mixes PowerShell and GUIs! - built on Avalonia - PowerShell/GraphicalTools</div>
1reaction
kilasuitcommented, Sep 23, 2019

@Prakash82x are you sure this is running the Out-Gridview cmdlet from Microsoft.PowerShell.GraphicalTools module and not the one that is shipped in windows itself

to Confirm that it’s an issue with the Microsoft.PowerShell.GraphicalTools version can you try this

./Script-Name -ComputerName Server1.domail.com | Microsoft.PowerShell.GraphicalTools\Out-GridView

If that still gives the error then you will need to raise an issue in the Microsoft.PowerShell.GraphicalTools repository which is https://github.com/PowerShell/GraphicalTools

Read more comments on GitHub >

github_iconTop Results From Across the Web

Out-GridView Returns - PowerShell Team
Out -GridView can be used as a filtering tool for these cases to ensure that your filters will produce the output you expect....
Read more >
PowerShell Out-GridView is not displaying all of the output
I am using Out-GridView to display everything from a PS stack object I created; however, it does not display everything!
Read more >
PS Script run as Task, Out-Gridview not working
If I run the script in ISE the outgrid views appear, but when I create a scheduled task and run it manually the...
Read more >
A PowerShell Core Out-Gridview Solution
This command is intended as a workaround for PowerShell Core running on a Windows platform, presumably Windows 10. PowerShell Core does not ......
Read more >
calling Out-Gridview - SAPIEN Forums
I have created a FORM using PowerShell Studio v2014. On this form I have a button that when pressed will get the mapped...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found