在脚本中调用exec powershell.exe时使用Ruby变量
编写一些ruby代码,其中一些将使用exec Powershell.exe命令进行Powershell调用 如何使用现有的Ruby变量并将其传递给Powershell命令 代码:在脚本中调用exec powershell.exe时使用Ruby变量,ruby,powershell,Ruby,Powershell,编写一些ruby代码,其中一些将使用exec Powershell.exe命令进行Powershell调用 如何使用现有的Ruby变量并将其传递给Powershell命令 代码: 那不行。如何在powershell调用中使用mydata Ruby变量 要在字符串中插入值,需要使用双引号 exec "Powershell.exe write-host #{mydata}" 而不是 exec 'Powershell.exe write-host #{mydata}' exec 'Powershe
那不行。如何在powershell调用中使用mydata Ruby变量 要在字符串中插入值,需要使用双引号
exec "Powershell.exe write-host #{mydata}"
而不是
exec 'Powershell.exe write-host #{mydata}'
exec 'Powershell.exe write-host #{mydata}'