Copy-VMFile 和 Invoke-Command 不适用于 Win7/Win8 客户机

问题描述

Copy-VMFile 和 Invoke-Command 的问题,Windows 7 和 Windows 8 虚拟机是在 Hyper-V 中创建的。 Hyper-V 服务器运行在 Windows 10 系统上。

我还必须从 windows7/windows 8 虚拟机上的主机系统复制一些文件,但出现此错误。 Copy-VMFile : Failed to initiate copying files to the guest. Failed to copy the source file 'C:\file.ps1' to the destination 'C:\file.ps1' in the guest. 'win7/win8' failed to initiate copying files to the guest: The device is not ready for use. (0x800710DF). (Virtual machine <id>) 'win7/win8' failed to copy the source file 'C:\file.ps1' to the destination 'C:\file.ps1' in the guest: The device is not ready for use. (0x800710DF). (Virtual machine ID <id>) At line:1 char:1 + Copy-VMFile -VMName win7/win8 -SourcePath C:\file.ps1 ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [Copy-VMFile],VirtualizationException + FullyQualifiedErrorId : OperationFailed,Microsoft.HyperV.PowerShell.Commands.CopyVMFile 我运行这个命令: Copy-VMFile -VMName win7/win8-SourcePath C:\file.ps1 -DestinationPath C:\file.ps1 -CreateFullPath -FileSource Host

然后,当我想在其中一台虚拟机上运行脚本时,我得到以下信息: An error has occurred which Windows PowerShell cannot handle. A remote session might have ended. + CategoryInfo : OpenError: (win7/win8:String) [],PSRemotingDataStructureException + FullyQualifiedErrorId : PSSessionStateBroken

我运行这个命令: Invoke-Command -VMName win7/win8 -ScriptBlock {powershell.exe -ExecutionPolicy Bypass -File C:\test.ps1} -Credential $cred

如果您能帮助我,我将不胜感激,我想提一下,对于 Windows 10 虚拟机,它运行完美。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)