FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Add GraphicalHost assembly to enable Out-GridView, Show-Command, and Get-Help -ShowWindow by SteveL-MSFT · Pull Request #10899 · PowerShell/PowerShell · GitHub

Add GraphicalHost assembly to enable Out-GridView, Show-Command, and Get-Help -ShowWindow - #10899

Merged
Aditya Patwardhan (adityapatwardhan) merged 23 commits into
PowerShell:masterfrom
SteveL-MSFT:graphicalhost
Nov 1, 2019
Merged

Add GraphicalHost assembly to enable Out-GridView, Show-Command, and Get-Help -ShowWindow#10899
Aditya Patwardhan (adityapatwardhan) merged 23 commits into
PowerShell:masterfrom
SteveL-MSFT:graphicalhost

Conversation

Steve Lee (SteveL-MSFT) commented Oct 25, 2019
edited
Loading

Copy link
Copy Markdown
Member

PR Summary

Add back GraphicalHost assembly code to enable Out-GridView, Show-Command, and Get-Help -ShowWindow on Windows only.

Some of the original code was changed for updated copyright and some style issues. Because of a difference in the Windows build system vs dotnet msbuild on embedding resources, had to change resgen to work with what XAML expects. I would focus the code review on source code that was already in this repo that had to be changed to make this work. The original WPF code is largely unchanged except where needed to get it to compile.

No automated tests so I did some manual validation for all three commands.

In the future, we'll probably want to split this out as a separate module, but currently part of the code is in SMA.dll and the rest is in GraphicalHost.dll. Removing the SMA.dll code is not trivial as we need to expose new public APIs for the module in how the cmdlet talks to the WPF window. Also the cmdlet is part of Utility module which is a breaking change in itself.

Note the source folder is the namespace name as resgen uses that to produce the path to the resources and the code expects that path.

PR Context

Fix #10599
Fix #9778

PR Checklist

Steve Lee (SteveL-MSFT) changed the title WIP: Add GraphicalHost assembly to enable Out-GridView, Show-Command, and Get-Help -ShowWindow Add GraphicalHost assembly to enable Out-GridView, Show-Command, and Get-Help -ShowWindow Oct 25, 2019
Comment thread build.psm1
Comment thread build.psm1
Comment thread build.psm1
Steve Lee (SteveL-MSFT) changed the title Add GraphicalHost assembly to enable Out-GridView, Show-Command, and Get-Help -ShowWindow WIP: Add GraphicalHost assembly to enable Out-GridView, Show-Command, and Get-Help -ShowWindow Oct 26, 2019

Copy link
Copy Markdown
Member Author

Marking it WIP as I work through the Codacy and Codefactor issues

Copy link
Copy Markdown
Contributor

I still think this should be an external module 😞

Copy link
Copy Markdown
Member Author

Joel Bennett (@Jaykul) did you read the PR description above?

Steve Lee (SteveL-MSFT) changed the title WIP: Add GraphicalHost assembly to enable Out-GridView, Show-Command, and Get-Help -ShowWindow Add GraphicalHost assembly to enable Out-GridView, Show-Command, and Get-Help -ShowWindow Oct 26, 2019

Ilya (iSazonov) left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Reviewed commit by commit.

Comment thread assets/files.wxs

Copy link
Copy Markdown
Member Author

Sean Wheeler (@sdwheeler) does Show-Command also need a new fwlink?

Comment thread assets/files.wxs

Sean Wheeler (sdwheeler) commented Oct 29, 2019
edited by unfurl-links Bot
Loading

Copy link
Copy Markdown
Collaborator

Steve Lee (@SteveL-MSFT) Show-Command https://go.microsoft.com/fwlink/?linkid=2109589

The Show-Command cmdlet lets you create a Windows PowerShell command in a command window. You can use the features of the command window to run the command or have it return the command to you. Show-Command is a very useful teaching and learning tool. Show-Command works on all command types, including cmdlets, functions, workflows and CIM commands. Without parameters, Show-Command displays a command window that lists all available commands in all installed modules. To find the commands in a module, select the module from the Modules drop-down list. To select a command, click the command name. To use the command window, select a command, either by using the Name or by clicking the command name in the Commands list. Each parameter set is displayed on a separate tab. Asterisks indicate the mandatory parameters. To enter values for a parameter, type the value in the text box or select the value from the drop-down box. To add a switch parameter, click to select the parameter check box. When you're ready, you can click Copy to copy the command that you've created to the clipboard or click Run to run the command. You can also use the PassThru parameter to return the command to the host program, such as the Windows PowerShell console. To cancel the command selection and return to the view that displays all commands, press Ctrl and click the selected command. In the Windows PowerShell Integrated Scripting Environment (ISE), a variation of the Show-Command window is displayed by default. For information about using this command window, see the Windows PowerShell ISE Help topics. This cmdlet was introduced in Windows PowerShell 3.0.

Aditya Patwardhan (adityapatwardhan) commented Oct 30, 2019
edited by unfurl-links Bot
Loading

Copy link
Copy Markdown
Member

Steve Lee (@SteveL-MSFT) please resolve merge conflict.

Also, open a PR in the PowerShell-Native repo to add the new assembly in the trusted assemblies list:

https://github.com/PowerShell/PowerShell-Native/blob/d4acbd519d1c77e07abc894db42853055ef65f55/src/powershell-native/nativemsh/pwrshcommon/pwrshcommon.cpp#L684-L686

GitHub
Contribute to PowerShell/PowerShell-Native development by creating an account on GitHub.

Steve Lee (SteveL-MSFT) commented Oct 31, 2019
edited
Loading

Copy link
Copy Markdown
Member Author

Aditya Patwardhan (@adityapatwardhan) does it make sense to add it to trusted assemblies since it can't be used remotely?

Copy link
Copy Markdown
Member

Steve Lee (@SteveL-MSFT) merging this PR. I can confirm with Paul Higinbotham (@PaulHigin) if the change in trusted assemblies must be made. It does not block this PR.

Aditya Patwardhan (adityapatwardhan) merged commit ca68d9d into PowerShell:master Nov 1, 2019
Aditya Patwardhan (adityapatwardhan) added the CL-General Indicates that a PR should be marked as a general cmdlet change in the Change Log label Nov 1, 2019

Copy link
Copy Markdown

🎉v7.0.0-preview.6 has been released which incorporates this pull request.:tada:

Handy links:

Copy link
Copy Markdown

Get-Help -ShowWindow only shows the first paragraph of text for each parameter. This is a bug from Windows PowerShell that seems to have been carried over

Ilya (iSazonov) commented Nov 22, 2019
edited by unfurl-links Bot
Loading

Copy link
Copy Markdown
Collaborator

RichardSiddaway No plans exist to fix the old code. All new graphical cmdlets will be in https://github.com/PowerShell/GraphicalTools Also MSFT team has a plan to rewrite Help module.

GitHub
A module that mixes PowerShell and GUIs! - built on Avalonia - PowerShell/GraphicalTools

Steve Lee (SteveL-MSFT) deleted the graphicalhost branch November 22, 2019 17:49

Copy link
Copy Markdown
Member Author

RichardSiddaway, Ilya (@iSazonov) is correct, this is simply a straight port with no plans to invest in these tools. They are added for parity with Windows PowerShell.

Copy link
Copy Markdown

That's a shame that a long standing bug has been allowed to propagate into v7

Copy link
Copy Markdown
Collaborator

RichardSiddaway We are not happy too. I hope there are people who will port the cmdlets. Welcome to these projects.

Copy link
Copy Markdown
Contributor

Thatgfsj (Thatgfsj) pushed a commit to Thatgfsj/PowerShell that referenced this pull request Aug 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CL-General Indicates that a PR should be marked as a general cmdlet change in the Change Log

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Out-GridView not working as expected on PowerShell 7 Help command in PS 6.2.1 has a non-functional -ShowWindow parameter

8 participants


Back | FazBrowse Home | New Git URL