Add GraphicalHost assembly to enable Out-GridView, Show-Command, and Get-Help -ShowWindow#10899
Conversation
update resource namespaces to match
suppress newline for show-command output as it doesn't work with psreadline
|
Marking it WIP as I work through the Codacy and Codefactor issues |
|
I still think this should be an external module 😞 |
|
@Jaykul did you read the PR description above? |
|
@iSazonov I'm ok deferring the code cleanup. However, it's a large amount of code. I'd rather focus this effort on the changes to files outside of the graphicalhost code base since that code base is from Windows PowerShell and has been working for some time. I don't want to invest in improving GraphicalHost, this is purely a parity with Windows PowerShell effort. I'd rather invest in a cross platform version of the tools over time. |
iSazonov
left a comment
There was a problem hiding this comment.
Reviewed commit by commit.
...werShell.Commands.Utility/commands/utility/FormatAndOutput/OutGridView/OutGridViewCommand.cs
Show resolved
Hide resolved
|
@sdwheeler does Show-Command also need a new fwlink? |
|
@SteveL-MSFT Show-Command https://go.microsoft.com/fwlink/?linkid=2109589
|
|
@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:
|
|
@adityapatwardhan does it make sense to add it to trusted assemblies since it can't be used remotely? |
|
@SteveL-MSFT merging this PR. I can confirm with @PaulHigin if the change in trusted assemblies must be made. It does not block this PR. |
|
🎉 Handy links: |
|
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 |
|
@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.
|
|
@RichardSiddaway, @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. |
|
That's a shame that a long standing bug has been allowed to propagate into v7 |
|
@RichardSiddaway We are not happy too. I hope there are people who will port the cmdlets. Welcome to these projects. |
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
.h,.cpp,.cs,.ps1and.psm1files have the correct copyright headerWIP:or[ WIP ]to the beginning of the title (theWIPbot will keep its status check atPendingwhile the prefix is present) and remove the prefix when the PR is ready.