我想從我的Hyper-V主機收集一些信息。我有一大堆他們想要自動化這個過程。 我需要獲取每臺主機上運行的虛擬機。 我想從批處理腳本執行此操作。 當我運行在PowerShell的V1.0窗口(Hyper-V主機上)這個命令它的工作原理,並給了我所需要的信息:使用批處理來運行遠程PowerShell V1.0命令
get-vmmemory | select VMelementName,reservation | out-file c:\Output.txt
這是怎麼了我從一個批處理腳本運行以下命令:
\\<RemoteMachine>\c$\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -command get-vmmemory >>aa.txt
這是輸出我得到
The term 'get-vmmemory' is not recognized as the name of a cmdlet, function,
script file, or operable program. Check the spelling of the name, or if a path
was included, verify that the path is correct and try again.
At line:1 char:16
+ & {get-vmmemory <<<< }
+ CategoryInfo : ObjectNotFound: (get-vmmemory:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
沒有人有任何線索,爲什麼我不斷收到這個輸出?
試試這個:'start「」「c:\ Windows \ System32 \ WindowsPowerShell \ v1.0 \ powershell.exe」....' – Endoro 2013-03-19 13:30:13