惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

C
Check Point Blog
罗磊的独立博客
量子位
Microsoft Azure Blog
Microsoft Azure Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
J
Java Code Geeks
M
MIT News - Artificial intelligence
月光博客
月光博客
IT之家
IT之家
D
DataBreaches.Net
A
About on SuperTechFans
博客园 - 三生石上(FineUI控件)
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Last Week in AI
Last Week in AI
D
Docker
The GitHub Blog
The GitHub Blog
B
Blog
V
Visual Studio Blog
博客园 - Franky
N
Netflix TechBlog - Medium
博客园 - 【当耐特】
Martin Fowler
Martin Fowler
博客园 - 聂微东
U
Unit 42

博客园 - Jerry Qian

.net新技术书箱推荐 .net 操作excel的xml形式 wcf powershell type 一堂如何提高代码质量的培训课(转) powershell basic powershell spirit .net国际化 怎样在存储过程及Sql语句之间选择 转 MSBuild 简解 10-29 为什么linq以select开头 loadruuner 角本录制 test infopath 转log4net 配置 Service Broker 资料 sharepoint 安装 转 计算机端口介绍
powershell parse
Jerry Qian · 2010-01-07 · via 博客园 - Jerry Qian

单引号里面的字符不会转义。

又引号里面的会转义,变量会被实际的值更改,并且里面的单引号直接输出。

转义列表

`n Newline
`r Carriage return
`t Horizontal tab
`a Alert
`b Backspace
`' Single quote
`" Double quote
`0 Null
`` A single backtick

在执行命令时如果有空格可以用 ` 来替换

We discussed the basic command and pipeline syntax and command parameter
binding.
• PowerShell has four types of commands: cmdlets, functions, script commands,
and native commands, each with slightly different characteristics.
• We discussed the notion of elastic syntax—concise on the command line and
complete in scripts.
• The fact that PowerShell is a command language as well as a scripting language
impacts how it parses text in a number of ways:
• PowerShell parses scripts in two modes: expression mode and command mode,
which is a critical point to appreciate when using PowerShell.
• The PowerShell escape character is backtick (`), not backslash.
• PowerShell supports both double-quotes and single-quotes; variable and expression
expansion is done in double quotes but not in single quotes.
• Line termination is handled specially in PowerShell because it is a command
language.
• PowerShell uses a sophisticated formatting and outputting system to determine
how to render objects without requiring detailed input from the user.