Skip to content

Instantly share code, notes, and snippets.

@PrateekKumarSingh
Created July 5, 2016 10:50
Show Gist options
  • Save PrateekKumarSingh/839c757ee53f812d255eeb4bff7c341d to your computer and use it in GitHub Desktop.
Save PrateekKumarSingh/839c757ee53f812d255eeb4bff7c341d to your computer and use it in GitHub Desktop.
Function Get-Clipboard
{
If ([Windows.clipboard]::ContainsText('CommaSeparatedValue')) {[Windows.clipboard]::GetText('CommaSeparatedValue')}
elseif ([Windows.clipboard]::ContainsText('Text')) {[Windows.clipboard]::GetText('Text')}
elseif ([Windows.clipboard]::ContainsText('Html')) {[Windows.clipboard]::GetText('Html')}
elseif ([Windows.clipboard]::ContainsText('Rtf')) {[Windows.clipboard]::GetText('Rtf')}
elseif ([Windows.clipboard]::ContainsFileDropList()) {[Windows.clipboard]::ContainsImage()}
}
Set-Alias -Name gcb -Value Get-Clipboard
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment