is there a way to display powershell code in a code block with the correct visual elements to it (colour, font, etc)? We are moving to modern pages for our internal how to guides and this would help visually if possible.

up vote 1 down vote accepted

One possible Solution would be to "pre-format" your code and then paste it into the new pages.

There are a lot of online and offline tools that could help with that.

The main issue you will have is the missing Script Editor Webpart or equivalent on the modern pages. I would suggest to use wikipages for information that inherits code snippets.

If you want to try how that could look like, test some of your snippets here and copy paste the html information into the page.

It could look something like that enter image description here

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.