0
我要替换在该命令的路径:串内插环境变量
$Env:PHANTOMJS_BIN='D:\michael\software\phantomjs-1.9.7-windows\phantomjs.exe'
通过该调用的输出:
Split-Path (Get-Command phantomjs).Path
优选使用串内插,这怎么可能在PowerShell中?
我要替换在该命令的路径:串内插环境变量
$Env:PHANTOMJS_BIN='D:\michael\software\phantomjs-1.9.7-windows\phantomjs.exe'
通过该调用的输出:
Split-Path (Get-Command phantomjs).Path
优选使用串内插,这怎么可能在PowerShell中?
这取决于您是要替换当前会话还是永久变量。也是机器范围还是为用户?这里是一个设置机器永久环境变量的示例:
[Environment]::SetEnvironmentVariable("PHANTOMJS_BIN", (Split-Path (Get-Command phantomjs).Path), [EnvironmentVariableTarget]::Machine)
你对字符串插值有什么意义?