Search
OneNoteGem
  • Home
  • Addins
    • Windows Office Addins >
      • Gem for OneNote
      • OneNote Search Bar
      • OneNote Gem - Favorites
      • OneNote Batch
      • Pons for MindManager and OneNote
      • Mind Map for OneNote
      • Pons for Visio and OneNote
      • Row to OneNote
      • Auto OneNote
      • Favorite to OneNote
      • Bridge for EndNote and OneNote
      • Anchor to OneNote
      • Anchor to OneNote for PDF
      • Bring to OneNote
      • Gem Table for OneNote
    • Windows UWP Addins >
      • Gem Menu for OneNote UWP
      • CiteBoard for OneNote
      • OneReader
      • OneMind for Windows OneNote
      • OneNote Reminder Cloud (UWP)
      • OneNote Batch Cloud (UWP)
    • Mac Addins >
      • Gem Menu for Mac OneNote
      • CiteBoard for OneNote
      • Bring to Mac OneNote
      • OneMind for Mac OneNote
      • OneNote Reminder for Mac
      • OneNote Batch for Mac
      • Fix One for Mac - Fix OneNote Login, Sync Tools
    • Android Addins >
      • CiteBoard for OneNote
      • Fix One for Android - Fix OneNote Login, Sync Tools
    • Cross-Platform Addins >
      • OneNote Reminder
      • OneMind for OneNote
      • CiteBoard for OneNote
      • Fix One - Fix OneNote Login, Sync Tools
    • Markdown Addins >
      • Gem for OneNote
      • One Markdown
    • Mind Map Addins >
      • OneNote Gem - Favorites
      • Pons for MindManager and OneNote
      • Mind Map for OneNote
      • Pons for Visio and OneNote
      • OneMind for OneNote
    • Other Addins >
      • One Markdown
      • Clip to OneNote
      • WordNote
      • OneShare
      • Fix One for Windows - Fix OneNote Login, Sync Tools
  • Buy
  • Documents
  • FAQs
  • Templates
  • Support
  • Release
  • WordNote
Gem Table for OneNote
 
 
The table of merged cells for OneNote

UWP: How to Copy Code from PowerShell ISE to OneNote and Maintain Syntax Highlighting?

2019-11-22 08:15
 
Gem Menu for OneNote UWP provides the ability to paste rich text to OneNote for Windows 10.

In many cases, OneNote will remove text format when you copied and pasted text , including: text color, background color, some space are removed.

And these text formats are not in HTML format, they may be rich text format.
Lead to the original formatted text, beyond recognition.
 
Here's an example with the PowerShell ISE that comes with Windows.
{C}
Copy Code Highlighted with Syntax from PowerShell ISE 
We copy the code in the PowerShell ISE that comes with Windows.
These codes appear to be colored. It is easy to distinguish between variable names and strings.
Copy Code Highlighted with Syntax from PowerShell ISE
 
Code Loses Color After Pasted to OneNote 
In OneNote for Windows 10, press Ctrl + V to paste the PowerShell code and you'll find that all the colors in the code are gone.
Code Loses Color After Pasted to OneNote
 
Use the Paste Rich Text Feature of Gem Menu to Keep the Color of the Code 
To keep the color of your code, you can use the Paste Rich text feature of the Gem Menu.

Click Gem Menu for OneNote UWP -> “Edit” menu -> “Paste Rich Text” menu item.
Use the Paste Rich Text Feature of Gem Menu to Keep the Color of the Code
 
And, the PowerShell code pasted into the OneNote UWP maintains the original syntax highlight color.

The background color will even be preserved.
 
Demonstration
Use Gem Menu’s Paste Rich text feature to paste the code copied from Windows PowerShell ISE to OneNote, and keep the syntax highlighted.
 

 
Download Gem Menu for OneNote UWP

Related Documents

  • UWP: Copy LaTeX to Generate Image Equation into OneNote
  • UWP: Insert Syntax Highlighted Program Code in OneNote for Windows 10
  • UWP: Copy Content from OneNote, and Paste to Twitter as Plain Text
Command Line
Tag System
MindMap Add-Ins Comparison
Search Add-Ins Comparison
One Markdown Syntax
Table Formula
Gantt

Gem Menu Templates
Repair OneNote
OneNote Download
English website Chinese website
Mobile Site
Copyright © 2011-2025 Digital GemSoft. OneNoteGem.com All Rights Reserved.