如果$b="aa,bb"

Start-Process PowerShell.exe -Argumentlist "d:\w.ps1 $a $b $c"

Start-Process powershell.exe "d:\w.ps1 $a $b $c"

则 $b 中的 逗号 会被识别为特殊字符,在此处会自动被替换,通过 replace 方法可以保留 逗号,如下:

$b2 = $b.Replace(",","','")

Start-Process powershell.exe "d:\w.ps1 $a $b2 $c"

相关文章:

  • 2021-12-20
  • 2022-12-23
  • 2022-12-23
  • 2021-08-08
  • 2021-08-07
  • 2021-08-23
  • 2021-05-20
  • 2021-09-04
猜你喜欢
  • 2021-06-07
  • 2021-11-24
  • 2021-04-27
  • 2021-10-04
  • 2021-10-21
  • 2021-08-19
  • 2021-07-16
相关资源
相似解决方案