【发布时间】:2011-04-11 22:39:05
【问题描述】:
当我从脚本运行以下行时,文件最终会在我的本地计算机上创建。
$cred = Get-Credential domain\DanTest
Enter-PSSession -computerName xsappb01 -credential $cred
New-Item -type file c:\temp\blahxsappk02.txt
exit-pssession
当我从 powershell 控制台单独运行每一行时,远程会话会正确创建,并且文件会在远程计算机上创建。关于为什么的任何想法?可能是脚本的时间问题吗?
【问题讨论】:
标签: powershell powershell-remoting