1/** 2 * SyntaxHighlighter 3 * http://alexgorbatchev.com/SyntaxHighlighter 4 * 5 * SyntaxHighlighter is donationware. If you are using it, please donate. 6 * http://alexgorbatchev.com/SyntaxHighlighter/donate.html 7 * 8 * @version 9 * 3.0.90 (Sat, 18 Jun 2016 21:01:41 GMT) 10 * 11 * @copyright 12 * Copyright (C) 2004-2013 Alex Gorbatchev. 13 * 14 * @license 15 * Dual licensed under the MIT and GPL licenses. 16 */ 17;(function() 18{ 19 // CommonJS 20 SyntaxHighlighter = SyntaxHighlighter || (typeof require !== 'undefined'? require('shCore').SyntaxHighlighter : null); 21 22 function Brush() 23 { 24 // Contributed by Joel 'Jaykul' Bennett, http://PoshCode.org | http://HuddledMasses.org 25 var keywords = 'while validateset validaterange validatepattern validatelength validatecount ' + 26 'until trap switch return ref process param parameter in if global: '+ 27 'function foreach for finally filter end elseif else dynamicparam do default ' + 28 'continue cmdletbinding break begin alias \\? % #script #private #local #global '+ 29 'mandatory parametersetname position valuefrompipeline ' + 30 'valuefrompipelinebypropertyname valuefromremainingarguments helpmessage '; 31 32 var operators = ' and as band bnot bor bxor casesensitive ccontains ceq cge cgt cle ' + 33 'clike clt cmatch cne cnotcontains cnotlike cnotmatch contains ' + 34 'creplace eq exact f file ge gt icontains ieq ige igt ile ilike ilt ' + 35 'imatch ine inotcontains inotlike inotmatch ireplace is isnot le like ' + 36 'lt match ne not notcontains notlike notmatch or regex replace wildcard'; 37 38 var verbs = 'write where wait use update unregister undo trace test tee take suspend ' + 39 'stop start split sort skip show set send select scroll resume restore ' + 40 'restart resolve resize reset rename remove register receive read push ' + 41 'pop ping out new move measure limit join invoke import group get format ' + 42 'foreach export expand exit enter enable disconnect disable debug cxnew ' + 43 'copy convertto convertfrom convert connect complete compare clear ' + 44 'checkpoint aggregate add'; 45 46 // I can't find a way to match the comment based help in multi-line comments, because SH won't highlight in highlights, and javascript doesn't support lookbehind 47 var commenthelp = ' component description example externalhelp forwardhelpcategory forwardhelptargetname forwardhelptargetname functionality inputs link notes outputs parameter remotehelprunspace role synopsis'; 48 49 this.regexList = [ 50 { regex: new RegExp('^\\s*#[#\\s]*\\.('+this.getKeywords(commenthelp)+').*$', 'gim'), css: 'preprocessor help bold' }, // comment-based help 51 { regex: SyntaxHighlighter.regexLib.singleLinePerlComments, css: 'comments' }, // one line comments 52 { regex: /(<|<)#[\s\S]*?#(>|>)/gm, css: 'comments here' }, // multi-line comments 53 54 { regex: new RegExp('@"\\n[\\s\\S]*?\\n"@', 'gm'), css: 'script string here' }, // double quoted here-strings 55 { regex: new RegExp("@'\\n[\\s\\S]*?\\n'@", 'gm'), css: 'script string single here' }, // single quoted here-strings 56 { regex: new RegExp('"(?:\\$\\([^\\)]*\\)|[^"]|`"|"")*[^`]"','g'), css: 'string' }, // double quoted strings 57 { regex: new RegExp("'(?:[^']|'')*'", 'g'), css: 'string single' }, // single quoted strings 58 59 { regex: new RegExp('[\\$|@|@@](?:(?:global|script|private|env):)?[A-Z0-9_]+', 'gi'), css: 'variable' }, // $variables 60 { regex: new RegExp('(?:\\b'+verbs.replace(/ /g, '\\b|\\b')+')-[a-zA-Z_][a-zA-Z0-9_]*', 'gmi'), css: 'functions' }, // functions and cmdlets 61 { regex: new RegExp(this.getKeywords(keywords), 'gmi'), css: 'keyword' }, // keywords 62 { regex: new RegExp('-'+this.getKeywords(operators), 'gmi'), css: 'operator value' }, // operators 63 { regex: new RegExp('\\[[A-Z_\\[][A-Z0-9_. `,\\[\\]]*\\]', 'gi'), css: 'constants' }, // .Net [Type]s 64 { regex: new RegExp('\\s+-(?!'+this.getKeywords(operators)+')[a-zA-Z_][a-zA-Z0-9_]*', 'gmi'), css: 'color1' }, // parameters 65 ]; 66 }; 67 68 Brush.prototype = new SyntaxHighlighter.Highlighter(); 69 Brush.aliases = ['powershell', 'ps', 'posh']; 70 71 SyntaxHighlighter.brushes.PowerShell = Brush; 72 73 // CommonJS 74 typeof(exports) != 'undefined' ? exports.Brush = Brush : null; 75})(); 76