You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Re-enabled the existing Clipboard code for Windows which relies on the Clipboard class from WinForms. For Linux, it requires xclip and macOS pbcopy and pbpaste. Had to #ifdef out a bunch of code that only works on Windows for copy/pasting non-text types. On Linux/macOS, decided to retain the parameters even if not supported to provide a more detailed error message.
Had to modify typegen as one of the types in Winforms being used has no HashAlgorithm so typegen threw. Instead, it skips assemblies where no HashAlgorithm is used which appears to only be an Accessibility assembly associated with WinForms.
To support win-arm builds, creating new WINFORMS def in csproj and uses clip.exe to set the clipboard, but no cmdline tool on win-arm to get contents of clipboard so had to disable all tests on win-arm since it depends on getting content out.
To support PSXunit tests, default to Microsoft.NET.Sdk if SDKToUse is not explicitly defined.
If the PR is work in progress, please add the prefix WIP: or [ WIP ] to the beginning of the title (the WIP bot will keep its status check at Pending while the prefix is present) and remove the prefix when the PR is ready.
@PowerShell/powershell-committee there is a request to remove dependency on WinForms and call the win32 apis directly. WinForms automatically gave us support for FileDropList, Audio, and Image formats (the latter two simply return a .NET object that has metadata about the content). The first one allowed copying files from Explorer and outputting their file paths, but required specifying that explicitly: Get-ClipBoard -Format FileDropList. I would propose that we simplify this and have consistency across platforms by only supporting text. This would also remove the -Format and -Raw params which would no longer be needed.
@PowerShell/powershell-committee reviewed this, since the code exists for the PInvokes and we prefer consistency across different platforms, we agreed to remove dependency on WinForms and wait for feedback if any customer needs -Format
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
CL-GeneralIndicates that a PR should be marked as a general cmdlet change in the Change LogCommittee-ReviewedPS-Committee has reviewed this and made a decision
7 participants
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Summary
Re-enabled the existing Clipboard code for Windows which relies on the Clipboard class from WinForms. For Linux, it requires
xclipand macOSpbcopyandpbpaste. Had to#ifdefout a bunch of code that only works on Windows for copy/pasting non-text types. On Linux/macOS, decided to retain the parameters even if not supported to provide a more detailed error message.Had to modify typegen as one of the types in Winforms being used has no HashAlgorithm so typegen threw. Instead, it skips assemblies where no HashAlgorithm is used which appears to only be an Accessibility assembly associated with WinForms.
To support win-arm builds, creating new WINFORMS def in csproj and uses clip.exe to set the clipboard, but no cmdline tool on win-arm to get contents of clipboard so had to disable all tests on win-arm since it depends on getting content out.
To support PSXunit tests, default to Microsoft.NET.Sdk if SDKToUse is not explicitly defined.
PR Context
Fix #4307
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.