本站源代码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

206 lines
7.3KB

  1. <!doctype html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <title>CodeMirror: Powershell mode</title>
  6. <link rel="stylesheet" href="../../doc/docs.css">
  7. <link rel="stylesheet" href="../../lib/codemirror.css">
  8. <script src="../../lib/codemirror.js"></script>
  9. <script src="../../addon/edit/matchbrackets.js"></script>
  10. <script src="powershell.js"></script>
  11. <style>.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
  12. </head>
  13. <body>
  14. <div id=nav>
  15. <a href="https://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
  16. <ul>
  17. <li><a href="../../index.html">Home</a>
  18. <li><a href="../../doc/manual.html">Manual</a>
  19. <li><a href="https://github.com/codemirror/codemirror">Code</a>
  20. </ul>
  21. <ul>
  22. <li><a href="../index.html">Language modes</a>
  23. <li><a class=active href="#">JavaScript</a>
  24. </ul>
  25. </div>
  26. <article>
  27. <h2>PowerShell mode</h2>
  28. <div><textarea id="code" name="code">
  29. # Number Literals
  30. 0 12345
  31. 12kb 12mb 12gB 12Tb 12PB 12L 12D 12lkb 12dtb
  32. 1.234 1.234e56 1. 1.e2 .2 .2e34
  33. 1.2MB 1.kb .1dTb 1.e1gb
  34. 0x1 0xabcdef 0x3tb 0xelmb
  35. # String Literals
  36. 'Literal escaping'''
  37. 'Literal $variable'
  38. "Escaping 1`""
  39. "Escaping 2"""
  40. "Escaped `$variable"
  41. "Text, $variable and more text"
  42. "Text, ${variable with spaces} and more text."
  43. "Text, $($expression + 3) and more text."
  44. "Text, $("interpolation $("inception")") and more text."
  45. @"
  46. Multiline
  47. string
  48. "@
  49. # --
  50. @"
  51. Multiline
  52. string with quotes "'
  53. "@
  54. # --
  55. @'
  56. Multiline literal
  57. string with quotes "'
  58. '@
  59. # Array and Hash literals
  60. @( 'a','b','c' )
  61. @{ 'key': 'value' }
  62. # Variables
  63. $Variable = 5
  64. $global:variable = 5
  65. ${Variable with spaces} = 5
  66. # Operators
  67. = += -= *= /= %=
  68. ++ -- .. -f * / % + -
  69. -not ! -bnot
  70. -split -isplit -csplit
  71. -join
  72. -is -isnot -as
  73. -eq -ieq -ceq -ne -ine -cne
  74. -gt -igt -cgt -ge -ige -cge
  75. -lt -ilt -clt -le -ile -cle
  76. -like -ilike -clike -notlike -inotlike -cnotlike
  77. -match -imatch -cmatch -notmatch -inotmatch -cnotmatch
  78. -contains -icontains -ccontains -notcontains -inotcontains -cnotcontains
  79. -replace -ireplace -creplace
  80. -band -bor -bxor
  81. -and -or -xor
  82. # Punctuation
  83. () [] {} , : ` = ; .
  84. # Keywords
  85. elseif begin function for foreach return else trap while do data dynamicparam
  86. until end break if throw param continue finally in switch exit filter from try
  87. process catch
  88. # Built-in variables
  89. $$ $? $^ $_
  90. $args $ConfirmPreference $ConsoleFileName $DebugPreference $Error
  91. $ErrorActionPreference $ErrorView $ExecutionContext $false $FormatEnumerationLimit
  92. $HOME $Host $input $MaximumAliasCount $MaximumDriveCount $MaximumErrorCount
  93. $MaximumFunctionCount $MaximumHistoryCount $MaximumVariableCount $MyInvocation
  94. $NestedPromptLevel $null $OutputEncoding $PID $PROFILE $ProgressPreference
  95. $PSBoundParameters $PSCommandPath $PSCulture $PSDefaultParameterValues
  96. $PSEmailServer $PSHOME $PSScriptRoot $PSSessionApplicationName
  97. $PSSessionConfigurationName $PSSessionOption $PSUICulture $PSVersionTable $PWD
  98. $ShellId $StackTrace $true $VerbosePreference $WarningPreference $WhatIfPreference
  99. $true $false $null
  100. # Built-in functions
  101. A:
  102. Add-Computer Add-Content Add-History Add-Member Add-PSSnapin Add-Type
  103. B:
  104. C:
  105. Checkpoint-Computer Clear-Content Clear-EventLog Clear-History Clear-Host Clear-Item
  106. Clear-ItemProperty Clear-Variable Compare-Object Complete-Transaction Connect-PSSession
  107. ConvertFrom-Csv ConvertFrom-Json ConvertFrom-SecureString ConvertFrom-StringData
  108. Convert-Path ConvertTo-Csv ConvertTo-Html ConvertTo-Json ConvertTo-SecureString
  109. ConvertTo-Xml Copy-Item Copy-ItemProperty
  110. D:
  111. Debug-Process Disable-ComputerRestore Disable-PSBreakpoint Disable-PSRemoting
  112. Disable-PSSessionConfiguration Disconnect-PSSession
  113. E:
  114. Enable-ComputerRestore Enable-PSBreakpoint Enable-PSRemoting Enable-PSSessionConfiguration
  115. Enter-PSSession Exit-PSSession Export-Alias Export-Clixml Export-Console Export-Counter
  116. Export-Csv Export-FormatData Export-ModuleMember Export-PSSession
  117. F:
  118. ForEach-Object Format-Custom Format-List Format-Table Format-Wide
  119. G:
  120. Get-Acl Get-Alias Get-AuthenticodeSignature Get-ChildItem Get-Command Get-ComputerRestorePoint
  121. Get-Content Get-ControlPanelItem Get-Counter Get-Credential Get-Culture Get-Date
  122. Get-Event Get-EventLog Get-EventSubscriber Get-ExecutionPolicy Get-FormatData Get-Help
  123. Get-History Get-Host Get-HotFix Get-Item Get-ItemProperty Get-Job Get-Location Get-Member
  124. Get-Module Get-PfxCertificate Get-Process Get-PSBreakpoint Get-PSCallStack Get-PSDrive
  125. Get-PSProvider Get-PSSession Get-PSSessionConfiguration Get-PSSnapin Get-Random Get-Service
  126. Get-TraceSource Get-Transaction Get-TypeData Get-UICulture Get-Unique Get-Variable Get-Verb
  127. Get-WinEvent Get-WmiObject Group-Object
  128. H:
  129. help
  130. I:
  131. Import-Alias Import-Clixml Import-Counter Import-Csv Import-LocalizedData Import-Module
  132. Import-PSSession ImportSystemModules Invoke-Command Invoke-Expression Invoke-History
  133. Invoke-Item Invoke-RestMethod Invoke-WebRequest Invoke-WmiMethod
  134. J:
  135. Join-Path
  136. K:
  137. L:
  138. Limit-EventLog
  139. M:
  140. Measure-Command Measure-Object mkdir more Move-Item Move-ItemProperty
  141. N:
  142. New-Alias New-Event New-EventLog New-Item New-ItemProperty New-Module New-ModuleManifest
  143. New-Object New-PSDrive New-PSSession New-PSSessionConfigurationFile New-PSSessionOption
  144. New-PSTransportOption New-Service New-TimeSpan New-Variable New-WebServiceProxy
  145. New-WinEvent
  146. O:
  147. oss Out-Default Out-File Out-GridView Out-Host Out-Null Out-Printer Out-String
  148. P:
  149. Pause Pop-Location prompt Push-Location
  150. Q:
  151. R:
  152. Read-Host Receive-Job Receive-PSSession Register-EngineEvent Register-ObjectEvent
  153. Register-PSSessionConfiguration Register-WmiEvent Remove-Computer Remove-Event
  154. Remove-EventLog Remove-Item Remove-ItemProperty Remove-Job Remove-Module
  155. Remove-PSBreakpoint Remove-PSDrive Remove-PSSession Remove-PSSnapin Remove-TypeData
  156. Remove-Variable Remove-WmiObject Rename-Computer Rename-Item Rename-ItemProperty
  157. Reset-ComputerMachinePassword Resolve-Path Restart-Computer Restart-Service
  158. Restore-Computer Resume-Job Resume-Service
  159. S:
  160. Save-Help Select-Object Select-String Select-Xml Send-MailMessage Set-Acl Set-Alias
  161. Set-AuthenticodeSignature Set-Content Set-Date Set-ExecutionPolicy Set-Item
  162. Set-ItemProperty Set-Location Set-PSBreakpoint Set-PSDebug
  163. Set-PSSessionConfiguration Set-Service Set-StrictMode Set-TraceSource Set-Variable
  164. Set-WmiInstance Show-Command Show-ControlPanelItem Show-EventLog Sort-Object
  165. Split-Path Start-Job Start-Process Start-Service Start-Sleep Start-Transaction
  166. Start-Transcript Stop-Computer Stop-Job Stop-Process Stop-Service Stop-Transcript
  167. Suspend-Job Suspend-Service
  168. T:
  169. TabExpansion2 Tee-Object Test-ComputerSecureChannel Test-Connection
  170. Test-ModuleManifest Test-Path Test-PSSessionConfigurationFile Trace-Command
  171. U:
  172. Unblock-File Undo-Transaction Unregister-Event Unregister-PSSessionConfiguration
  173. Update-FormatData Update-Help Update-List Update-TypeData Use-Transaction
  174. V:
  175. W:
  176. Wait-Event Wait-Job Wait-Process Where-Object Write-Debug Write-Error Write-EventLog
  177. Write-Host Write-Output Write-Progress Write-Verbose Write-Warning
  178. X:
  179. Y:
  180. Z:</textarea></div>
  181. <script>
  182. var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
  183. mode: "powershell",
  184. lineNumbers: true,
  185. indentUnit: 4,
  186. tabMode: "shift",
  187. matchBrackets: true
  188. });
  189. </script>
  190. <p><strong>MIME types defined:</strong> <code>application/x-powershell</code>.</p>
  191. </article>
  192. </body>
  193. </html>
上海开阖软件有限公司 沪ICP备12045867号-1