我有一个使用Vagrant 1.8.4构建的Hyper-V VM,我正在尝试使用" vagrant powershell"命令启动已配置(使用puppet)到VM上的脚本。可以轻松访问某些目录,例如C:\ users \ vagrant。我完全控制了这个文件夹和所有后续目录。每当我尝试启动脚本,甚至使用' dir'访问某些文件夹时命令,我收到一条错误,指出"权限被拒绝"。
这是一个简单的" vagrant powershell的输出-c' C:\ provision \ shell'"命令:
vagrant : The following WinRM command responded with a non-zero exit status.
+ CategoryInfo : NotSpecified: (The following W...ro exit status.:String) [], RemoteException
+ FullyQualifiedErrorId : NativeCommandError
Vagrant assumes that this means the command failed!
dir 'C:\provision\shell'
Stdout from the command:
Stderr from the command:
#< CLIXML
<Objs Version="1.1.0.1" xmlns="http://schemas.microsoft.com/powershell/2004/04"><S S="Error">dir : Access to the
path 'C:\provision\shell' is denied._x000D__x000A_</S><S S="Error">At line:1 char:40_x000D__x000A_</S><S
S="Error">+ $ProgressPreference='SilentlyContinue';dir 'C:\provision\shell'_x000D__x000A_</S><S S="Error">+
~~~~~~~~~~~~~~~~~~~~~~~~_x000D__x000A_</S><S S="Error"> + CategoryInfo :
PermissionDenied: (C:\provision\shell:String) [Get-ChildItem], UnauthorizedAccessExcepti _x000D__x000A_</S><S
S="Error"> on_x000D__x000A_</S><S S="Error"> + FullyQualifiedErrorId :
DirUnauthorizedAccessError,Microsoft.PowerShell.Commands.GetChildItemCommand_x000D__x000A_</S><S S="Error">
_x000D__x000A_</S></Objs>
如果有人可以帮我弄清楚为什么我会得到这些&#34;许可被拒绝&#34;错误,那将是伟大的!
非常感谢任何协助。
答案 0 :(得分:0)
这个问题是我试图使用&#34; vagrant powershell&#34;来连接到VM。而在遥远的pssession。 Windows没有通过我的凭据,因为我已经远程访问并尝试将SMB文件夹访问回VM主机,这不是我的本地计算机。 SMB共享文件夹是一个符号链接&#39;这就是发生绊倒的地方。如果我有一个委托令牌(例如使用CredSSP),则可能已授予访问权限。
正如我的评论中所述,我 能够通过配置的PowerShell脚本复制共享文件夹的内容。丑陋,但有效。
感谢codekaizen帮助我制定回复(信用到期的信用)。