powershell - 如何在Powershell中转义 "and '的混合物?

标签 powershell

/[Path='/'].applicationPool:"ASP.NET v4.0"

这整行实际上是一个参数,所以我想在它周围加上单引号。但它不起作用,因为它已经包含单引号。

我尝试过在单引号前面添加`,但没有成功。

有什么建议吗?

最佳答案

您必须用引号引起来并用反引号转义内部引号:

"/[Path='/'].applicationPool:`"ASP.NET v4.0`""

关于powershell - 如何在Powershell中转义 "and '的混合物?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8349224/

相关文章:

Azure AD - OSX 上的 Powershell

powershell - 将批处理脚本转换为Powershell脚本

powershell - 当目标文件夹存在或不存在时复制项目

string - 比较行,-notcontains 被忽略

azure - 收到警告 : SCM Credentials on Azure WebApp deployment

powershell - ForEach循环中的变量被覆盖-Powershell

powershell - 为什么PowerShell.BeginInvoke不调用回调?

powershell - Azure DevOps-在PowerShell脚本中设置和使用变量

excel - 使用 PowerShell 将一个 csv 文件中的列复制到另一个文件

powershell - 对 Active Directory 中的数据进行分组