问题描述
所以我使用了这个非常简单的脚本(在这种情况下),脚本在 cca 10 秒内完成,但它只是等待一分钟多然后完成
这里是脚本在本地运行的打印屏幕,脚本运行了超过一分钟 Script local
这是在服务器上,由同一用户运行,并且脚本运行大约 2 秒的相同凭据 Script on server
有人知道我为什么或我能做什么吗?
$Username = 'xxxxxxx'
$Password = 'xxxxxxx'
$pass = ConvertTo-securestring -AsPlainText $Password -Force
$Cred = New-Object System.Management.Automation.PSCredential -ArgumentList $Username,$pass
Write-Output 'Start:'
Get-Date
Write-Output 'Server:'
Invoke-Command -ComputerName xxxxxxx.xxx.xxx.xxx-ScriptBlock { Get-Date } -credential $Cred
Write-Output 'Finish:'
Get-Date
谢谢
大卫 V.
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)