By Patrick Wahlmueller

AI and Automation in Practice

Technical Insights 1 min read

How to Remove Clipboard Formatting with PowerShell

A quick PowerShell one-liner to strip formatting from your clipboard – plus how to turn it into a taskbar shortcut.

Often there is a need to eliminate formatting in the clipboard. This can be done with Microsoft Office – but of course also with PowerShell – and very easily.

# Correct Version
Get-Clipboard | Set-Clipboard

# Short
gcb | scb

And sometimes you might not have a PowerShell Window open. So hit Windows + R and run one of these:

# PowerShell 7
pwsh -nop -c "&{gcb|scb}"

# Windows PowerShell
powershell -noprofile -command "& {gcb|scb}"

So this is the easy PowerShell way to remove format information in the clipboard. Since I need it really often I created a shortcut with the command in the properties and put it into the taskbar – so I only need to click it and the formatting is gone. Simply great!