PageSourceSearch

https://radioislam.or.id/wp-content/plugins/syntaxhighlighter/synt…/scripts/shBrushPowerShell.js?ver=2.1.364

js radioislam.or.id collected 2026-09-24 08:51:18 UTC 4,365 bytes, 76 lines download raw bytes

1/**
2 * SyntaxHighlighter
3 * http://alexgorbatchev.com/
4 *
5 * SyntaxHighlighter is donationware. If you are using it, please donate.
6 * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate
7 *
8 * @version
9 * 2.1.364 (October 15 2009)
10 *
11 * @copyright
12 * Copyright (C) 2004-2009 Alex Gorbatchev.
13 *
14 * @license
15 * This file is part of SyntaxHighlighter.
16 *
17 * SyntaxHighlighter is free software: you can redistribute it and/or modify
18 * it under the terms of the GNU Lesser General Public License as published by
19 * the Free Software Foundation, either version 3 of the License, or
20 * (at your option) any later version.
21 *
22 * SyntaxHighlighter is distributed in the hope that it will be useful,
23 * but WITHOUT ANY WARRANTY; without even the implied warranty of
24 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
25 * GNU General Public License for more details.
26 *
27 * You should have received a copy of the GNU General Public License
28 * along with SyntaxHighlighter.  If not, see <http://www.gnu.org/copyleft/lesser.html>.
29 */
30SyntaxHighlighter.brushes.PowerShell = function()
31{
32	// Contributes by B.v.Zanten, Getronics
33	// http://confluence.atlassian.com/display/CONFEXT/New+Code+Macro
34
35	var keywords = 'Add-Content Add-History Add-Member Add-PSSnapin Clear(-Content)? Clear-Item ' +
36				'Clear-ItemProperty Clear-Variable Compare-Object ConvertFrom-SecureString Convert-Path ' +
37				'ConvertTo-Html ConvertTo-SecureString Copy(-Item)? Copy-ItemProperty Export-Alias ' +
38				'Export-Clixml Export-Console Export-Csv ForEach(-Object)? Format-Custom Format-List ' +
39				'Format-Table Format-Wide Get-Acl Get-Alias Get-AuthenticodeSignature Get-ChildItem Get-Command ' +
40				'Get-Content Get-Credential Get-Culture Get-Date Get-EventLog Get-ExecutionPolicy ' +
41				'Get-Help Get-History Get-Host Get-Item Get-ItemProperty Get-Location Get-Member ' +
42				'Get-PfxCertificate Get-Process Get-PSDrive Get-PSProvider Get-PSSnapin Get-Service ' +
43				'Get-TraceSource Get-UICulture Get-Unique Get-Variable Get-WmiObject Group-Object ' +
44				'Import-Alias Import-Clixml Import-Csv Invoke-Expression Invoke-History Invoke-Item ' +
45				'Join-Path Measure-Command Measure-Object Move(-Item)? Move-ItemProperty New-Alias ' +
46				'New-Item New-ItemProperty New-Object New-PSDrive New-Service New-TimeSpan ' +
47				'New-Variable Out-Default Out-File Out-Host Out-Null Out-Printer Out-String Pop-Location ' +
48				'Push-Location Read-Host Remove-Item Remove-ItemProperty Remove-PSDrive Remove-PSSnapin ' +
49				'Remove-Variable Rename-Item Rename-ItemProperty Resolve-Path Restart-Service Resume-Service ' +
50				'Select-Object Select-String Set-Acl Set-Alias Set-AuthenticodeSignature Set-Content ' +
51				'Set-Date Set-ExecutionPolicy Set-Item Set-ItemProperty Set-Location Set-PSDebug ' +
52				'Set-Service Set-TraceSource Set(-Variable)? Sort-Object Split-Path Start-Service ' +
53				'Start-Sleep Start-Transcript Stop-Process Stop-Service Stop-Transcript Suspend-Service ' +
54				'Tee-Object Test-Path Trace-Command Update-FormatData Update-TypeData Where(-Object)? ' +
55				'Write-Debug Write-Error Write(-Host)? Write-Output Write-Progress Write-Verbose Write-Warning';
56	var alias = 'ac asnp clc cli clp clv cpi cpp cvpa diff epal epcsv fc fl ' +
57				'ft fw gal gc gci gcm gdr ghy gi gl gm gp gps group gsv ' +
58				'gsnp gu gv gwmi iex ihy ii ipal ipcsv mi mp nal ndr ni nv oh rdr ' +
59				'ri rni rnp rp rsnp rv rvpa sal sasv sc select si sl sleep sort sp ' +
60				'spps spsv sv tee cat cd cp h history kill lp ls ' +
61				'mount mv popd ps pushd pwd r rm rmdir echo cls chdir del dir ' +
62				'erase rd ren type % \\?';
63
64	this.regexList = [
65		{ regex: /#.*$/gm,										css: 'comments' },  // one line comments
66		{ regex: /\$[a-zA-Z0-9]+\b/g,							css: 'value'   },   // variables $Computer1
67		{ regex: /\-[a-zA-Z]+\b/g,								css: 'keyword' },   // Operators    -not  -and  -eq
68		{ regex: SyntaxHighlighter.regexLib.doubleQuotedString,	css: 'string' },    // strings
69		{ regex: SyntaxHighlighter.regexLib.singleQuotedString,	css: 'string' },    // strings
70		{ regex: new RegExp(this.getKeywords(keywords), 'gmi'),	css: 'keyword' },
71		{ regex: new RegExp(this.getKeywords(alias), 'gmi'),	css: 'keyword' }
72	];
73};
74
75SyntaxHighlighter.brushes.PowerShell.prototype = new SyntaxHighlighter.Highlighter();
76SyntaxHighlighter.brushes.PowerShell.aliases = ['powershell', 'ps'];

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.