Is new-pssession the same as psexec?

馋奶兔 提交于 2019-12-11 14:35:29

问题


Is pssession the same as psexec?

If I use new-pssession to create a session to a remote PC, is it the same as using psexec?

If we can use invoke-command -computername to create a temporary session, what is the benefit using pssseion to create a persistent connection?

Under what circumstances should I use new-pssession?


回答1:


New-PSSession is used when you have multiple commands, or even a script, to be run against a remote machine. Invoke-Command and psexec both allow you to run a single command remotely, and though that command could execute a script, it's not necessarily the best tool for the job.



来源:https://stackoverflow.com/questions/23790493/is-new-pssession-the-same-as-psexec

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!