Deprecated: Function ereg() is deprecated in /home/jaykul/joelbennett.net/wordpress/wp-content/plugins/source.php on line 59

Deprecated: Function ereg() is deprecated in /home/jaykul/joelbennett.net/wordpress/wp-content/plugins/source.php on line 64

Warning: Cannot modify header information - headers already sent by (output started at /home/jaykul/joelbennett.net/wordpress/wp-content/plugins/source.php:59) in /home/jaykul/joelbennett.net/wordpress/wp-content/plugins/source.php on line 68

Warning: Cannot modify header information - headers already sent by (output started at /home/jaykul/joelbennett.net/wordpress/wp-content/plugins/source.php:59) in /home/jaykul/joelbennett.net/wordpress/wp-content/plugins/source.php on line 71
'Posh', 'COMMENT_SINGLE' => array(1 => '#'), 'COMMENT_MULTI' => array('<#'=>'#>'), 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE, 'QUOTEMARKS' => array('"', "'"), 'HARDQUOTE' => array('@"$','^"@'), // An optional 2-element array defining the beginning and end of a hard-quoted string 'HARDESCAPE' => array(), // Things that must still be escaped inside a hard-quoted string // If HARDQUOTE is defined, HARDESCAPE must be defined // This will not work unless the first character of each element is either in the // QUOTEMARKS array or is the ESCAPE_CHAR 'ESCAPE_CHAR' => '`', 'KEYWORDS' => array( 1 => array( # PoSH keywords/reserved words # [type]::gettype("System.Management.Automation.KeywordTokenReader").InvokeMember("_keywordTokens", "NonPublic,Static,GetField", $null, $_, @() ).GetEnumerator()|%{$_.Name.Trim("-")}|?{$_ -match "^[A-z]"}|Sort -Desc|Join-String "', '" -Prefix "'" -Postfix "'" | clip 'while', 'var', 'using', 'until', 'try', 'trap', 'throw', 'switch', 'return', 'process', 'param', 'in', 'if', 'function', 'from', 'foreach', 'for', 'finally', 'filter', 'exit', 'end', 'elseif', 'else', 'dynamicparam', 'do', 'define', 'data', 'continue', 'class', 'catch', 'break', 'begin' ), 2 => array( # Operators # [type]::gettype("System.Management.Automation.OperatorTokenReader").InvokeMember("_expressionOperatorTokens", "NonPublic,Static,GetField", $null, $_, @() ).GetEnumerator()|%{$_.Name.Trim("-")}|?{$_ -match "^[A-z]"}|Sort -Desc|Join-String "', '" -Prefix "'" -Postfix "'" | clip 'xor', 'split', 'replace', 'or', 'notmatch', 'notlike', 'notcontains', 'not', 'ne', 'match', 'lt', 'like', 'le', 'join', 'isplit', 'isnot', 'is', 'ireplace', 'inotmatch', 'inotlike', 'inotcontains', 'ine', 'imatch', 'ilt', 'ilike', 'ile', 'igt', 'ige', 'ieq', 'icontains', 'gt', 'ge', 'f', 'eq', 'csplit', 'creplace', 'contains', 'cnotmatch', 'cnotlike', 'cnotcontains', 'cne', 'cmatch', 'clt', 'clike', 'cle', 'cgt', 'cge', 'ceq', 'ccontains', 'bxor', 'bor', 'bnot', 'band', 'as', 'and' ), # built in language type shorcuts, plus a couple of .Net base types... # [type]::gettype("System.Management.Automation.TypeAccelerators")::get.GetEnumerator()|%{$_.Key}|Sort -Desc|Join-String "', '" -Prefix "'" -Postfix "'" | clip 3 => array( 'xml', 'wmisearcher', 'wmiclass', 'wmi', 'type', 'switch', 'string', 'single', 'scriptblock', 'runspacefactory', 'runspace', 'regex', 'ref', 'psprimitivedictionary', 'psobject', 'psmoduleinfo', 'pscustomobject', 'powershell', 'long', 'ipaddress', 'int', 'hashtable', 'float', 'double', 'decimal', 'char', 'byte', 'bool', 'array', 'adsisearcher', 'adsi' ), 4 => array( # DEFAULT (NoProfile) list of aliases and functions (filtered to remove verb-noun functions which will already be highlighted, and to remove drive letter functions) # Combined list generated with: # gcm -type "Alias,Function,Filter" | Select -Expand Name | ?{$_ -match "[A-z]" -and $_ -notmatch "[A-z]-|:"}|Sort -Unique -Desc | %{[regex]::escape($_) -replace '.ps1$',''} |Join-String "', '" -Prefix "'" -Postfix "'" | clip 'write', 'wjb', 'where', 'type', 'tee', 'TabExpansion', 'swmi', 'sv', 'start', 'spsv', 'spps', 'spjb', 'sp', 'sort', 'sleep', 'sl', 'si', 'set', 'select', 'sc', 'sbp', 'sasv', 'saps', 'sal', 'sajb', 'rwmi', 'rvpa', 'rv', 'rsnp', 'rsn', 'rp', 'rnp', 'rni', 'rmo', 'rmdir', 'rm', 'rjb', 'ri', 'ren', 'rdr', 'rd', 'rcjb', 'rbp', 'r', 'pwd', 'pushd', 'ps', 'prompt', 'popd', 'oh', 'ogv', 'nv', 'nsn', 'nmo', 'ni', 'ndr', 'nal', 'mv', 'mp', 'move', 'mount', 'more', 'mkdir', 'mi', 'measure', 'md', 'man', 'ls', 'lp', 'kill', 'iwmi', 'ise', 'ipsn', 'ipmo', 'ipcsv', 'ipal', 'ImportSystemModules', 'ii', 'ihy', 'iex', 'icm', 'history', 'help', 'h', 'gwmi', 'gv', 'gu', 'gsv', 'gsnp', 'gsn', 'group', 'gps', 'gp', 'gmo', 'gm', 'gl', 'gjb', 'gi', 'ghy', 'gdr', 'gcs', 'gcm', 'gci', 'gc', 'gbp', 'gal', 'fw', 'ft', 'foreach', 'fl', 'fc', 'exsn', 'etsn', 'erase', 'epsn', 'epcsv', 'epal', 'echo', 'ebp', 'dir', 'diff', 'del', 'dbp', 'cvpa', 'cpp', 'cpi', 'cp', 'copy', 'compare', 'clv', 'cls', 'clp', 'cli', 'clhy', 'clear', 'clc', 'chdir', 'cd\\', 'cd\.\.', 'cd', 'cat', 'asnp', 'ac' ), ), 'SYMBOLS' => array( '(', ')', '[', ']', '{', '}', "-", "+", "=", '!', '%', '&', '*', '|', '/', '<', '>', ), 'CASE_SENSITIVE' => array( GESHI_COMMENTS => true, 1 => false, 2 => false, 3 => false, 4 => false, 5 => false, 6 => false, ), 'STYLES' => array( 'KEYWORDS' => array( 1 => 'color: #666699; font-weight: bold;', 2 => 'color: #333399; font-weight: bold; font-style: italic;', 3 => 'color: #003366; font-weight: bold;', 4 => 'color: #660033;', //~ 5 => 'color: #006600; font-style: italic;', //~ 6 => 'color: #000000; font-style: italic;', ), 'COMMENTS' => array( 1 => 'color: #666666; font-style: italic;', 'MULTI' => 'color: #666666; font-style: italic;' ), 'ESCAPE_CHAR' => array( 0 => 'color: #000099; font-weight: bold;' ), 'BRACKETS' => array( 0 => 'color: #333;' ), 'STRINGS' => array( 0 => 'color: #009900;' ), 'NUMBERS' => array( 0 => 'color: #cc66cc;' ), 'METHODS' => array( 1 => 'color: #003366;', 2 => 'color: #003366;', // 3 => 'color: #666;' ), 'SYMBOLS' => array( 0 => 'color: #66cc66;' ), 'REGEXPS' => array( 0 => 'color: #0066cc; font-style: italic;', # verb-noun 1 => 'font-style: normal;', # noun 2 => 'color: #000066;', # parameters 3 => 'color: #660033; font-weight: bold;', # variables 4 => 'color: #003366; font-weight: bold;', # types ), 'SCRIPT' => array( ) ), 'URLS' => array( ), 'OOLANG' => true, 'OBJECT_SPLITTERS' => array( 1 => '.', 2 => '::', ), 'REGEXPS' => array( # Verbs. This is the OFFICIAL list. Full SEARCH pattern GENERATED with this: # get-verb | %{$_.verb} | sort -unique -descending | Join-String -prefix "((?:" -Separator "|" -postfix ")-[a-zA-Z_][a-zA-Z0-9_]*)"|clip # NOTE: THIS HIGHLIGHTS THE WHOLE COMMAND 0 => array ( GESHI_SEARCH => '((?:Write|Watch|Wait|Use|Update|Unregister|Unpublish|Unprotect|Unlock|Uninstall|Undo|Unblock|Trace|Test|Sync|Switch|Suspend|Submit|Stop|Step|Start|Split|Skip|Show|Set|Send|Select|Search|Save|Revoke|Resume|Restore|Restart|Resolve|Reset|Request|Repair|Rename|Remove|Register|Redo|Receive|Read|Push|Publish|Protect|Pop|Ping|Out|Open|New|Move|Mount|Merge|Measure|Lock|Limit|Join|Invoke|Install|Initialize|Import|Hide|Group|Grant|Get|Format|Find|Export|Expand|Exit|Enter|Enable|Edit|Dismount|Disconnect|Disable|Deny|Debug|Copy|ConvertTo|ConvertFrom|Convert|Connect|Confirm|Compress|Complete|Compare|Close|Clear|Checkpoint|Block|Backup|Assert|Approve|Add)-[a-zA-Z_][a-zA-Z0-9_]*)', GESHI_REPLACE => '\\1', GESHI_MODIFIERS => 'i', GESHI_BEFORE => '', GESHI_AFTER => '' ), # Nouns come after a Verb and a dash. This is the OFFICIAL list. Full SEARCH pattern GENERATED with this: # get-verb | %{$_.verb} | sort -unique -descending | Join-String -Separator "|" -prefix "((?:" -postfix ")-)([a-zA-Z_][a-zA-Z0-9_]*)"|clip # HYPOTHETICALLY, if you wanted a list of the actual nouns on your system: # get-command | foreach-object{$_.noun} | sort-object -unique -descending | Join-String -Separator "|" -prefix "((?:" -postfix "))"|clip # NOTE: THIS HIGHLIGHTS JUST THE NOUN 1 => array ( GESHI_SEARCH => '((?:Write|Watch|Wait|Use|Update|Unregister|Unpublish|Unprotect|Unlock|Uninstall|Undo|Unblock|Trace|Test|Sync|Switch|Suspend|Submit|Stop|Step|Start|Split|Skip|Show|Set|Send|Select|Search|Save|Revoke|Resume|Restore|Restart|Resolve|Reset|Request|Repair|Rename|Remove|Register|Redo|Receive|Read|Push|Publish|Protect|Pop|Ping|Out|Open|New|Move|Mount|Merge|Measure|Lock|Limit|Join|Invoke|Install|Initialize|Import|Hide|Group|Grant|Get|Format|Find|Export|Expand|Exit|Enter|Enable|Edit|Dismount|Disconnect|Disable|Deny|Debug|Copy|ConvertTo|ConvertFrom|Convert|Connect|Confirm|Compress|Complete|Compare|Close|Clear|Checkpoint|Block|Backup|Assert|Approve|Add)-)([a-zA-Z_][a-zA-Z0-9_]*)', GESHI_REPLACE => '\\2', GESHI_MODIFIERS => 'i', GESHI_BEFORE => '\\1', GESHI_AFTER => '' ), # Parameters come after a " -" ... and although I can generate a list using: # "(-(?:"+(get-command | foreach-object{$_.parametersets} | foreach-object {$_.parameters} | foreach-object {$_.name} | sort-object -unique -descending | Join-String -Separator "|")+"))" | Set-Clipboard ############### (?:Year|XsltPath|XPath|Write|Wrap|WorkingDirectory|Word|WindowStyle|Width|WhatIf|Warning|WaitTimeout|Wait|Volume|View|Version|Verify|Verbose|Verb|Variable|ValueOnly|Value|Validate|Utc|UseTimeFromFile|UserName|URL|Update|Unique|UFormat|TypeName|TTL|TrustLevel|Trusted|Truncate|Trace|TotalCount|To|Title|TimestampServer|TimeStamp|Timeout|Time|TID|Text|Temp|TargetObject|Target|Syntax|SyncWindow|Sum|Subject|Strings|StringEncoding|String|Strict|Stream|Step|Status|Statistic|Static|State|StartupType|Start|StackName|Stack|Speed|SourceId|SortBy|SmtpHost|Size|SingleLine|SimpleMatch|SID|ShowError|Shortname|SetModifiedTime|SetCreatedTime|SetAccessedTime|Server|Separator|Select|SecureString|SecureKey|SecondValue|SecondsRemaining|Seconds|Second|ScriptBlock|Scope|SchemaPath|SaveCred|Rtf|Root|Role|Retry|Resolve|ReplyTo|Repair|RemoveOriginal|RemoveListener|RemoveFileListener|RemoveEmptyStrings|Registered|RegexSeparator|Regex|ReferenceObject|Recurse|RecommendedAction|Reason|ReadOnly|ReadCount|Raw|Quiet|Query|Quality|Qualifier|PSSnapin|PSProvider|PSHost|PSDrive|PropertyType|Property|Prompt|Process|Privileges|Privilege|Priority|PrinterName|PrincipalName|PrependPath|PortNumber|PortName|PercentComplete|Percent|Pattern|PathType|Path|Password|PassThru|ParentID|Parent|Parameter|Paging|Owner|Overwrite|OutVariable|OutputPath|Output|OutBuffer|Option|Operation|OnType|OmitXmlDeclaration|Offset|Off|Object|NoWindow|Noun|NoTypeInformation|NoTrimEnd|Notify|NoShellExecute|NoQualifier|NoProfile|NoNewLine|NoLineBreak|NoHeader|NoElement|NoClobber|NoAscii|NoAddress|NewName|NewLine|Newest|Namespace|Name|MultiLine|Most|Month|Modified|Minutes|Minute|Minimum|Min|Milliseconds|Migrate|Message|MemberType|Maximum|Max|MacName|LogName|Log|Location|LocalizedHelpPath|LoadUserProfile|LiteralPath|LiteralName|ListenerOption|List|LineCount|Line|Level|Leaf|LastWord|Last|Label|KeyLength|KeyContainerName|KeyAlgorithm|Key|KeepAspectRatio|JobName|ItemType|IsValid|IsAbsolute|IpAddress|Interval|InterfaceName|Interactive|Insert|InputObject|Input|IndentString|Incremental|IncludeEqual|IncludeEmptyDirectories|IncludeChain|Include|Import|Image|IgnoreWhiteSpace|Ignore|Identity|Id|HtmlBody|Html|Hours|Hour|HostName|HideTableHeaders|Height|Head|Handle|GroupBy|Group|GlobalCatalog|Functionality|Full|From|FragmentOnly|Format|ForegroundColor|Force|Follow|FlattenPaths|First|FilterScript|Filter|Files|FilePath|FileName|Fast|Expression|ExpandProperty|Expand|ExecutionPolicy|ExcludeProperty|ExcludeDifferent|Exclude|Exception|Examples|Exact|EventName|ErrorVariable|ErrorRecord|ErrorLimit|ErrorLevel|ErrorId|ErrorAction|Erase|End|Encrypt|Encoding|EnableScript|Elapsed|DriveName|Drain|DomainName|Domain|DistinguishedName|DisplayName|DisplayHint|DisplayError|DirectoryName|DifferenceObject|Detailed|Destination|Description|Descending|Depth|DependsOn|Delimiter|Delete|Default|Debugger|Debug|Days|Day|Date|CurrentOperation|Culture|Csv|CSPType|CSPName|CryptoRng|Credential|Created|Create|Count|Continuous|Container|ConformanceLevel|Confirm|ComputerName|Compress|Component|Completed|Compatible|ComObject|CommandType|Command|Columns|Column|ClusterName|ClassName|Class|ChildPath|Character|Char|CertUsage|CertSubjectName|CertStoreLocation|CertSerialNumber|CertRequestFileName|CertIssuerName|Certificate|CertFile|Cc|CategoryTargetType|CategoryTargetName|CategoryReason|CategoryActivity|Category|CaseSensitive|Cache|BufferSize|Boost|Body|BlockCount|Bitmap|BinaryPathName|Binary|Begin|Before|Bcc|Base64Text|BackgroundColor|Average|AutoSize|Audit|Audio|AttributesOnNewLine|AttributeName|AttachmentPath|AttachmentLiteralPath|Asynchronous|AsString|AssemblyName|AsSecureString|AsPlainText|Ascending|As|Arguments|ArgumentList|ApplicationName|AppendPath|Append|Anonymous|Allocation|AllAddresses|All|Algorithm|After|Adjust|Activity|AclObject|ACL|Accessed) # Since you can abbreviate a parameter to it's shortest representation, it seems like the best thing is to just match any word starting with - # This *MIGHT* affect your math (if you don't leave a space after the -) but I think it'll be better than the alternatives 2 => array ( GESHI_SEARCH => ' (-[a-zA-Z_][a-zA-Z0-9_]*)', GESHI_REPLACE => '\\1', GESHI_MODIFIERS => 'i', GESHI_BEFORE => ' ', GESHI_AFTER => '' ), # Variables always start with $ and they can be pretty much whatever ... 3 => array ( GESHI_SEARCH => '(\\$[a-zA-Z_][a-zA-Z0-9_]*)', GESHI_REPLACE => '\\1', GESHI_MODIFIERS => '', GESHI_BEFORE => '', GESHI_AFTER => '' ), 4 => array ( GESHI_SEARCH => '(\[[a-z][a-z0-9_\.\]\[]+\])', GESHI_REPLACE => '\\1', GESHI_MODIFIERS => 'i', GESHI_BEFORE => '', GESHI_AFTER => '' ), ), 'STRICT_MODE_APPLIES' => GESHI_NEVER, 'SCRIPT_DELIMITERS' => array( ), 'HIGHLIGHT_STRICT_BLOCK' => array( ) ); ?>