Community Tools

The PowerShell community provides a wealth of information: users gladly share their findings on blogs and webpages, and announce their articles on twitter. ISESteroids provides tools to receive these announcements, and supports authors creating new community content for others.

For Readers: Twitter Ticker Receiving Community Content

On the far left side of the ISE status bar, ISESteroids adds a new toggle button that slides in and out the twitter bar. When you slide it in, it shows in real time the latest twitter posts about PowerShell.

Twitter Ticker

If you find an announcement interesting, and if it contains a link, click it to open the website with more details. If you want to announce on this channel yourself, sign up to twitter, and add the hashtag #PowerShell to your post.

Network Connectivity

Of course, the twitter ticker requires Internet connectivity. If you experience delays and sluggish behavior in ISESteroids, this may be due to connectivity problems. Turn off the twitter ticker to resolve this issue.

For Authors: Creating HTML from Code and Console Output

(introduced in ISESteroids 2.6.2.30)

When you include code in your blog posts or webpages, most people do either of this:

  • Post the code as plain text. Color coding gets lost, and the result looks not too good.
  • Use code coloring plugins. Their color coding is based in heuristics and is not always correct. It is sometimes hard for users to copy and paste the code. And it requires a plugin on the webserver.
  • Post screen shots. They look great but you cannot select and paste the code.

ISESteroids works different. When you select code in the editor pane or the console pane, right-click the selection and choose Selection / Copy as HTML (or simply press CTRL+ALT+C).

Copy as HTML

ISESteroids takes the selected code and turns it into standard HTML. The HTML is placed as text on the clipboard. This has a lot of advantages:

  • HTML preserves color coding exactly as it was before. You get the maximum fidelity.
  • HTML is compatible and requires no special plugins.
  • Code is easily copied and pasted by the reader of your blog.
  • You can even change the HTML later, remove or rename things, or highlight special parts with other colors. Any HTML editor will do.

To use the code in your blog or website, it just needs to support raw HTML. In WordPress, for example, you need to switch to the Text tab of the editor to paste the code. Once you switch back to the Visual tab, you see the code sample rendered, and can post-process it (change text, apply other colors).

The generated HTML includes some important formats:

  • No Translate: makes sure code is not translated when someone translates your blog or webpage
  • No Hyphen Wrap: makes sure your code is not wrapped in the middle of command names
  • Non Breaking Space: all whitespace is turned into non-breaking whitespace so formatting is preserved

Using HTML Templates

To further ease generation of HTML snippets for your blog, you can fine-tune and tailor the HTML snippets exactly to your needs.

By default, ISESteroids creates full HTML pages that you can save to file and display as individual web pages. This can be adjusted. When you create HTML (for example, by selecting code and pressing CTRL+ALT+C), the ISE statusbar shows a link “Edit template”.

Click “Edit template” to open the default template. There are two template files, one for code taken from the editor, and one for code taken from the console pane.

The editor template is called TemplateEditor.html:

<html>
<body>
<p translate="no" class="notranslate" style="font-family:Lucida Console,Monaco,monospace;">
<!--INSERTBODY-->
</p>
</body>
</html>

The console template is called TemplateConsole.html:

<html>
<body>
<p translate="no" class="notranslate" style="background-color:<!--INSERTBACKGROUNDCOLOR-->;font-family:Lucida Console,Monaco,monospace;">
<!--INSERTBODY-->
</p>
</body>
</html>

Simply change the template, replace the HTML and BODY statements with a TABLE structure, or make any other adjustment. Then save the file. The next time you turn code into HTML, ISESteroids uses your new template to compose it.