Syntax.register('powershell', function(brush) {
// PowerShell Cmdlets
var cmdlets = [ "Add-Content", "Add-History", "Add-Member", "Add-PSSnapin", "Clear-Content", "Clear-Item", "Clear-ItemProperty", "Clear-Variable", "Compare-Object", "ConvertFrom-SecureString", "Convert-Path", "ConvertTo-Html", "ConvertTo-SecureString", "Copy-Item", "Copy-ItemProperty", "Export-Alias", "Export-Clixml", "Export-Console", "Export-Csv", "ForEach-Object", "Format-Custom", "Format-List", "Format-Table", "Format-Wide", "Get-Acl", "Get-Alias", "Get-AuthenticodeSignature", "Get-ChildItem", "Get-Command", "Get-Content", "Get-Credential", "Get-Culture", "Get-Date", "Get-EventLog", "Get-ExecutionPolicy", "Get-Help", "Get-History", "Get-Host", "Get-Item", "Get-ItemProperty", "Get-Location", "Get-Member", "Get-PfxCertificate", "Get-Process", "Get-PSDrive", "Get-PSProvider", "Get-PSSnapin", "Get-Service", "Get-TraceSource", "Get-UICulture", "Get-Unique", "Get-Variable", "Get-WmiObject", "Group-Object", "Import-Alias", "Import-Clixml", "Import-Csv", "Invoke-Expression", "Invoke-History", "Invoke-Item", "Join-Path", "Measure-Command", "Measure-Object", "Move-Item", "Move-ItemProperty", "New-Alias", "New-Item", "New-ItemProperty", "New-Object", "New-PSDrive", "New-Service", "New-TimeSpan", "New-Variable", "Out-Default", "Out-File", "Out-Host", "Out-Null", "Out-Printer", "Out-String", "Pop-Location", "Push-Location", "Read-Host", "Remove-Item", "Remove-ItemProperty", "Remove-PSDrive", "Remove-PSSnapin", "Remove-Variable", "Rename-Item", "Rename-ItemProperty", "Resolve-Path", "Restart-Service", "Resume-Service", "Select-Object", "Select-String", "Set-Acl", "Set-Alias", "Set-AuthenticodeSignature", "Set-Content", "Set-Date", "Set-ExecutionPolicy", "Set-Item", "Set-ItemProperty", "Set-Location", "Set-PSDebug", "Set-Service", "Set-TraceSource", "Set-Variable", "Sort-Object", "Split-Path", "Start-Service", "Start-Sleep", "Start-Transcript", "Stop-Process", "Stop-Service", "Stop-Transcript", "Suspend-Service", "Tee-Object", "Test-Path", "Trace-Command", "Update-FormatData", "Update-TypeData", "Where-Object", "Write-Debug", "Write-Error", "Write-Host", "Write-Output", "Write-Progress", "Write-Verbose", "Write-Warning" ];
brush.push(cmdlets, {klass: 'cmdlet'});
// Aliases
var aliases = [ "ac", "asnp", "clc", "cli", "clp", "clv", "cpi", "cpp", "cvpa", "diff", "epal", "epcsv", "fc", "fl", "foreach", "ft", "fw", "gal", "gc", "gci", "gcm", "gdr", "ghy", "gi", "gl", "gm", "gp", "gps", "group", "gsv", "gsnp", "gu", "gv", "gwmi", "iex", "ihy", "ii", "ipal", "ipcsv", "mi", "mp", "nal", "ndr", "ni", "nv", "oh", "rdr", "ri", "rni", "rnp", "rp", "rsnp", "rv", "rvpa", "sal", "sasv", "sc", "select", "si", "sl", "sleep", "sort", "sp", "spps", "spsv", "sv", "tee", "?", "write", "cat", "cd", "clear", "cp", "h", "history", "kill", "lp", "ls", "mount", "mv", "popd", "ps", "pushd", "pwd", "r", "rm", "rmdir", "echo", "cls", "chdir", "copy", "del", "dir", "erase", "move", "rd", "ren", "set", "type" ];
brush.push(aliases, {klass: 'alias'});
// Reserved words
var keywords = [ "break", "continue", "do", "for", "foreach", "exit", "default", "while", "if", "switch", "until", "where", "function", "filter", "else", "elseif", "in", "return", "param", "throw", "trap" ];
brush.push(keywords, {klass: 'keyword'});
// Options
var options = [ "-Year", "-Wrap", "-Word", "-Width", "-WhatIf", "-Wait", "-View", "-Verbose", "-Verb", "-Variable", "-ValueOnly", "-Value", "-Unique", "-UFormat", "-TypeName", "-Trace", "-TotalCount", "-Title", "-TimestampServer", "-TargetObject", "-Syntax", "-SyncWindow", "-Sum", "-String", "-Strict", "-Stream", "-Step", "-Status", "-Static", "-StartupType", "-Start", "-StackName", "-Stack", "-SourceId", "-SimpleMatch", "-ShowError", "-Separator", "-SecureString", "-SecureKey", "-SecondValue", "-SecondsRemaining", "-Seconds", "-Second", "-Scope", "-Root", "-Role", "-Resolve", "-RemoveListener", "-RemoveFileListener", "-Registered", "-ReferenceObject", "-Recurse", "-RecommendedAction", "-ReadCount", "-Quiet", "-Query", "-Qualifier", "-PSSnapin", "-PSProvider", "-PSHost", "-PSDrive", "-PropertyType", "-Property", "-Prompt", "-Process", "-PrependPath", "-PercentComplete", "-Pattern", "-PathType", "-Path", "-PassThru", "-ParentId", "-Parent", "-Parameter", "-Paging", "-OutVariable", "-OutBuffer", "-Option", "-OnType", "-Off", "-Object", "-Noun", "-NoTypeInformation", "-NoQualifier", "-NoNewline", "-NoElement", "-NoClobber", "-NewName", "-Newest", "-Namespace", "-Name", "-Month", "-Minutes", "-Minute", "-Minimum", "-Milliseconds", "-Message", "-MemberType", "-Maximum", "-LogName", "-LiteralPath", "-LiteralName", "-ListenerOption", "-List", "-Line", "-Leaf", "-Last", "-Key", "-ItemType", "-IsValid", "-IsAbsolute", "-InputObject", "-IncludeEqual", "-IncludeChain", "-Include", "-IgnoreWhiteSpace", "-Id", "-Hours", "-Hour", "-HideTableHeaders", "-Head", "-GroupBy", "-Functionality", "-Full", "-Format", "-ForegroundColor", "-Force", "-First", "-FilterScript", "-Filter", "-FilePath", "-Expression", "-ExpandProperty", "-Expand", "-ExecutionPolicy", "-ExcludeProperty", "-ExcludeDifferent", "-Exclude", "-Exception", "-Examples", "-ErrorVariable", "-ErrorRecord", "-ErrorId", "-ErrorAction", "-End", "-Encoding", "-DisplayName", "-DisplayHint", "-DisplayError", "-DifferenceObject", "-Detailed", "-Destination", "-Description", "-Descending", "-Depth", "-DependsOn", "-Delimiter", "-Debugger", "-Debug", "-Days", "-Day", "-Date", "-CurrentOperation", "-Culture", "-Credential", "-Count", "-Container", "-Confirm", "-ComputerName", "-Component", "-Completed", "-ComObject", "-CommandType", "-Command", "-Column", "-Class", "-ChildPath", "-Character", "-Certificate", "-CategoryTargetType", "-CategoryTargetName", "-CategoryReason", "-CategoryActivity", "-Category", "-CaseSensitive", "-Body", "-BinaryPathName", "-Begin", "-BackgroundColor", "-Average", "-AutoSize", "-Audit", "-AsString", "-AsSecureString", "-AsPlainText", "-As", "-ArgumentList", "-AppendPath", "-Append", "-Adjust", "-Activity", "-AclObject" ];
brush.push(options, {klass: 'option'});
// Operators
var operators = [ "-eq", "-ne", "-gt", "-ge", "-lt", "-le", "-ieq", "-ine", "-igt", "-ige", "-ilt", "-ile", "-ceq", "-cne", "-cgt", "-cge", "-clt", "-cle", "-like", "-notlike", "-match", "-notmatch", "-ilike", "-inotlike", "-imatch", "-inotmatch", "-clike", "-cnotlike", "-cmatch", "-cnotmatch", "-contains", "-notcontains", "-icontains", "-inotcontains", "-ccontains", "-cnotcontains", "-isnot", "-is", "-as", "-replace", "-ireplace", "-creplace", "-and", "-or", "-band", "-bor", "-not", "-bnot", "-f", "-casesensitive", "-exact", "-file", "-regex", "-wildcard", "+=", "-=", "*=", "/=", "%=", "*", "/", "%", "=", "!" , "+", "-" ];
brush.push(operators, {klass: 'operator'});
// Symbols
var symbols = [ "(", ")", "[", "]", "{", "}", "", "|", "&", "@" ];
brush.push(symbols, {klass: 'symbol'});
// Constants
var constants = [ "SilentlyContinue" ];
brush.push(constants, {klass: 'constant'});
// Variables
brush.push({
pattern: /($|@|%)w+/gi,
klass: 'variable'
});
// Comments
brush.push(Syntax.lib.perlStyleComment);
brush.push(Syntax.lib.webLink);
// Strings
brush.push(Syntax.lib.singleQuotedString);
brush.push(Syntax.lib.doubleQuotedString);
brush.push(Syntax.lib.stringEscape);
// Numbers
brush.push(Syntax.lib.decimalNumber);
brush.push(Syntax.lib.hexNumber);
// Functions
brush.push(Syntax.lib.cStyleFunction);
});