小编eri*_*avg的帖子

Cygwin vs Linux虚拟机开发?

<skippable part>

我在Windows环境中从事IT工作(主要是桌面支持和网络管理),偶尔也会编程.

几周前,我认为如果没有Bash环境,我的命令提示需求就不会像我想要的那样有效.当我使用Ruby和git时尤其如此.我使用Msysgit一段时间了,但我只是不喜欢它不像Linux那样可扩展.所以,我安装了Cygwin并玩了几个星期.

与Cygwin一样伟大,它似乎是一个强大的命令提示符,它与Linux的兼容性只是一个令人愉快的副作用.当我尝试将Ruby升级到1.9.3(它工作,但它并不简单),安装rvm(从未工作),并安装RMagick(可能或可能不工作,但看起来很头疼)时,这尤其明显.

所以,现在我正在考虑在虚拟机中运行Linux.但是我担心这可能是另一种蠕虫,我会在发现它之前浪费几个小时.我喜欢Cygwin在Windows中运行,我可以使用我的IDE,用户文件夹等等.但是我不喜欢它的支持不像主要的发行版那么彻底.

</ skippable part>

  1. 这里有没有人对使用Cygwin和运行Linux虚拟机有所了解?
  2. 有关在Windows中的虚拟机中设置Linux开发环境的建议吗?

linux windows cygwin development-environment virtual-machine

18
推荐指数
2
解决办法
3万
查看次数

Powershell的Invoke-Command不会为-ComputerName参数接受变量?

我把头发拉到这里,因为我似乎无法让它发挥作用,我无法弄清楚如何谷歌这个问题.我正在运行Powershell 2.0.这是我的脚本:

$computer_names = "server1,server2"
Write-Output "Invoke-Command -ComputerName $computer_names -ScriptBlock { 
    Get-WmiObject -Class Win32_LogicalDisk | 
    sort deviceid | 
    Format-Table -AutoSize deviceid, freespace 
}"
Invoke-Command -ComputerName $computer_names -ScriptBlock { 
    Get-WmiObject -Class Win32_LogicalDisk | 
    sort deviceid | 
    Format-Table -AutoSize deviceid, freespace 
}
Run Code Online (Sandbox Code Playgroud)

最后一个命令给出错误:

Invoke-Command : One or more computer names is not valid. If you are trying to 
pass a Uri, use the -ConnectionUri parameter or pass Uri objects instead of 
strings.
Run Code Online (Sandbox Code Playgroud)

但是当我将Write-Output命令的输出复制到shell并运行它时,它可以正常工作.如何将字符串变量转换为Invoke-Command将接受的内容?提前致谢!

powershell powershell-2.0 powershell-remoting

6
推荐指数
2
解决办法
1万
查看次数