Skip to content

Instantly share code, notes, and snippets.

@webtroter
Last active November 20, 2025 19:40
Show Gist options
  • Select an option

  • Save webtroter/b621021cc5c70413eb80ba947e976778 to your computer and use it in GitHub Desktop.

Select an option

Save webtroter/b621021cc5c70413eb80ba947e976778 to your computer and use it in GitHub Desktop.
Invoke-TypeClipboard - Types your clipboard
<#
.SYNOPSIS
This will type the clipboard
.DESCRIPTION
This command will type the clipboard after a configurable delay, set at 2 seconds by default
.PARAMETER SecondsToSleep
Seconds to sleep before sending the clipboard
.EXAMPLE
PS> Invoke-TypeClipboard
#>
function Invoke-TypeClipboard {
[CmdletBinding()]
param (
# Sleep for X Seconds, defaults to 2 seconds
[Parameter()]
[int]
$SecondsToSleep = 2
)
begin {
$wshell = New-Object -ComObject wscript.shell
}
process {
Start-Sleep -Seconds $SecondsToSleep
$wshell.SendKeys( $(Get-Clipboard) )
}
end {
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment