Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Restore -Format option in Get-Clipboard #12290

Open
tats-u opened this issue Apr 10, 2020 · 4 comments
Open

Feature Request: Restore -Format option in Get-Clipboard #12290

tats-u opened this issue Apr 10, 2020 · 4 comments
Labels
Issue-Enhancement the issue is more of a feature request than a bug WG-Cmdlets-Management cmdlets in the Microsoft.PowerShell.Management module

Comments

@tats-u
Copy link

tats-u commented Apr 10, 2020

Summary of the new feature/enhancement

We used to be able to save images in the clipboard as files by following in Windows Powershell 5:

(gcb -format image).save("foo.png")

As you know, Get-Clipboard went somewhere in PowerShell Core 6 but came back in 7. The remaining problem is that only text is supported and we can't fetch images (and audio). Windows lacks the feature to save an image in the clipboard as a file. I don't want to run Paint 3D or something, paste one, and save it. (I found we can paste a medium in clipboard to Explorer)
PowerShell 7 is said to be compatible with 5, but this absence gives me an opportunity to run the legacy PowerShell 5.

Proposed technical implementation details (optional)

@tats-u tats-u added the Issue-Enhancement the issue is more of a feature request than a bug label Apr 10, 2020
@iSazonov
Copy link
Collaborator

If I remember right it was a design conclusion to have consistent behavior over all supported systems but we do not consider such scenario.

/cc @SteveL-MSFT @mklement0

@iSazonov iSazonov added WG-Cmdlets-Utility cmdlets in the Microsoft.PowerShell.Utility module WG-Cmdlets-Management cmdlets in the Microsoft.PowerShell.Management module and removed WG-Cmdlets-Utility cmdlets in the Microsoft.PowerShell.Utility module labels Apr 11, 2020
@thedavecarroll
Copy link

I would like to add that a method capable of outputting the image into different size chunks, such as the following, would be a welcomed addition.

$MediaFileInfo = Get-ChildItem $Path
$BufferSize = 900000
$Buffer = [Byte[]]::new($BufferSize)
$Reader = [System.IO.File]::OpenRead($MediaFileInfo.FullName)
$Media = [ArrayList]::new()
do {
    $BytesRead = $Reader.Read($Buffer, 0 , $BufferSize)
    $null = $Media.Add([Convert]::ToBase64String($Buffer, 0, $BytesRead))
} while ($BytesRead -eq $BufferSize)
$Reader.Dispose()

Perhaps something like ConvertToBase64() with a default or configurable buffer size?

Thank you,
Dave

@tats-u
Copy link
Author

tats-u commented Nov 21, 2023

Still no answers.
Do we have to use the WinForms directly or a 3rd-party CLI tool?

@microsoft-github-policy-service microsoft-github-policy-service bot removed the Resolution-No Activity Issue has had no activity for 6 months or more label Nov 21, 2023
@microsoft-github-policy-service microsoft-github-policy-service bot added the Resolution-No Activity Issue has had no activity for 6 months or more label May 19, 2024
@tats-u
Copy link
Author

tats-u commented May 19, 2024

Not fixed

@microsoft-github-policy-service microsoft-github-policy-service bot removed the Resolution-No Activity Issue has had no activity for 6 months or more label May 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Enhancement the issue is more of a feature request than a bug WG-Cmdlets-Management cmdlets in the Microsoft.PowerShell.Management module
Projects
None yet
Development

No branches or pull requests

3 participants