How to format content for posts

I have been using only PRE and slash-PRE with the the triangular left and right brackets to format PS code for posting. That’s all I know. But it seems there’s more – even though I am nowhere near posting advanced questions or problems. My biggest difficulty is in re-editing a post before finalizing. For example, when I “get back in”, some portions are now enclosed in a light blue background and I can’t seem to get rid of it. I first started doing the “first draft” on Notepad and do a Copy/Paste, but it seems not to reproduce faithfully. I also see the use of BBC codes to help in formatting. I have “experimented” on a simple very limited basis but do not wish to create “junk” posts that would waste the time/attention of the experts who are taking and giving serious technical questions and answers. I would appreciate some references to documentation on this specialized environment for posting narratives, PS code and other such related textual material so it is acceptable to the community. Many thanks.

There isn’t really anything “more,” no. We treat both the HTML “pre” tag and the square-bracket bbCode “pre” tag identically because people tend to try both.

That “background” is part of the application of the code formatting; editing from the Text tab lets you see the “unformatted” view. Frankly, and I do keep telling folks this, the very best way to post a code listing is to make a Gist from it on GitHub, and then paste the Gist’s URL here. That way GitHub can handle all the formatting and the code lives with them, where it’s easier to edit, copy/paste, and so on.

Apart from that just use the toolbar buttons. We honestly don’t need a lot of fancy formatting; syntax-colored code is nice, but Gist does the best possible job of that.

Can Gist do different colors and fonts?

# This is a PowerShell comment.

function MyFunction([Parameter(Position = 0)][System.String]$path)
    :loopLabel foreach ($thisFile in (Get-ChildItem $path))
        Write-Host ; Write-Host -Fore Yellow `
            ('Length:' +
            [System.Math]::Floor($thisFile.Length / 1000))

If you are skilled in CSS, you can use it to modify how the gist appears (but probably not on this site).

Check out for examples.