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.

New contributor
user3284404 is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
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 http://hilite.me/ and copy paste the html information into the page.

It could look something like that enter image description here

Your Answer

user3284404 is a new contributor. Be nice, and check out our Code of Conduct.
 
discard

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.