Hi Stuart,
the reason why it does not work, is that scope definitions allows only word characters in definition (exception is only one char construction). This is not really consistent, but I will try to adjust it with time. Other problem # is also occupied by comment starting.
So, to make it running you need to do a little bit more work (example is in cbase_spec.xml + c_spec.xml). Changes should be done in your powershell_spec.xml.
1) Add special style for such regions (helps to distinguish between comments and region definition):
<Style id="format_tag" name="Format tags" bold="2" italic="1" underline="0" clr="Format tag" bkclr="#FFFFFFFF">
<Blocks>
<Block open="#$" close="\n"/>
</Blocks>
</Style>
2) Change description of your scope to this one (to be allowed only in this new style):
<Scope open="region" close="endregion" has_name="true">
<Containers open="format_tag"/>
</Scope>
3) Add this to labels (optional, will show regions in Navigation Bar):
<Label group="Region" match="region\s+(\w+)\s*$" name="\1" scope="1" image="12">
<Containers open="format_tag"/>
</Label>
At the end, this snippet should be recognized as region with name AAAA:
#$ region AAAAA
something inside
#$ endregion
I will also update standard powershel_spec.xml soon to be available for others, so you can wait or add this by yourself.
Best regards,
Alex.
P.S: one more nice thing can be added, is adding of the new code template of such way:
#$ region %Region Name%
%SelectedText%
#$ endregion %Region Name%than from one side region construction will be suggested inside format tags and from another side you will get additional "surround by template" feature in format menu and in context menu, if something is selected