Tick in PowerShell

PowerShell uses a tick as a multipurpose escaped character.

A tick may be used as a line continuation character. Consider the following example:

'one' -replace 'o', 't' ` 
      -replace 'n', 'w' ` 
      -replace 'e', 'o' 

When using a tick to split a long statement across several lines, the tick must be the last character (it cannot be followed by a space or any other character).

A tick is used to construct several characters that can be used in strings:

Description String ASCII character code

Null

`0 0

Bell sound

`a 7

Backspace

`b 8

New page form feed

`f 12

Line feed

`n 10

Carriage return

`r 13

Horizontal tab

`t 9

Vertical tab

`v 11

 

The tab character, for example, may be included in a string:

PS> Write-Host "First`tSecond" 
First Second  

Alternatively, the bell sound may be played in the PowerShell console (but not ISE):

Write-Host "`a"
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.16.137.38