Last active
December 28, 2024 20:04
-
-
Save indy-singh/7b357a954683bae63d38ecce2d331fee to your computer and use it in GitHub Desktop.
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
| # required to load in the DLLs | |
| [Windows.ApplicationModel.DataTransfer.Clipboard, Windows.ApplicationModel.DataTransfer, ContentType=WindowsRuntime]; | |
| # this one doens't seem to work but registers fine | |
| [Windows.ApplicationModel.DataTransfer.Clipboard]::add_ContentChanged({[Console]::Beep()}); | |
| # this one does beep | |
| [Windows.ApplicationModel.DataTransfer.Clipboard]::add_HistoryChanged({[Console]::Beep()}); | |
| # Used | |
| # https://devblogs.microsoft.com/oldnewthing/20230303-00/?p=107894 | |
| # https://learn.microsoft.com/en-us/uwp/api/windows.applicationmodel.datatransfer.clipboard.contentchanged?view=winrt-26100 | |
| # https://stackoverflow.com/a/74225141 | |
| # https://www.therealomar.com/articles/2022-07/TIL-powershell-event-handlers | |
| # https://stackoverflow.com/a/64232782 |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Note: This only works in old school Powershell, pwsh (the newer one) blows up which I haven't bothered to look into.