Copy Color-Coded Code

by Dec 26, 2016

When you select code in the PowerShell ISE and copy it to the clipboard, it is copied in RTF format and preserves all color coding and font information. You can paste it in RTF-aware applications such as Word, and receive nicely formatted and color-coded PowerShell code.

To adjust the font size, you cannot use the slider in the lower right-hand side of the PowerShell ISE. This slider just scales the font inside the PowerShell ISE but does not affect the font size of copied code.

Instead, in the PowerShell ISE, choose Tools/Options, then adjust the font size in the Options dialog

Twitter This Tip! ReTweet this Tip!