我想要一个脚本来做以下事情:
是否可以批量进行? 如果不是,我还有什么其他的select?
如果你已经安装了powershell,下面的代码会在本地运行时得到一个正在运行的应用程序列表
gps | ? {$_.mainwindowtitle.length -ne 0} | select name, mainwindowtitle
如果在要查询的计算机上安装了Powershell V2,并且启用了远程处理,则可以运行:
invoke-command –computername <remote computer name> {gps | ? {$_.mainwindowtitle.length -ne 0} | select name, mainwindowtitle}