index.html 7.2 KB

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