如何解决无法加载文件或程序集 - Powershell
我正在尝试使用 Powershell 中的 Posh-SSH 模块通过 SFTP 发送文件。
但是,我只是使用以下命令在 powershell 中以管理员权限安装模块:
Install-Module Posh-SSH -Force
iex (New-Object Net.WebClient).DownloadString("https://gist.github.com/darkoperator/6152630/raw/c67de4f7cd780ba367cccbc2593f38d18ce6df89/instposhsshdev")
但是,当我在没有管理员权限的情况下运行 Powershell ISE 并调用我的脚本时,会出现下一个异常:
The 'New-SFTPSession' command was found in the module 'Posh-SSH',but the
module could not be loaded. For more information,run 'Import-Module Posh-SSH'.
根据 Powershell 的建议,我添加了命令“Import-Module Posh-SSH”,但出现了另一个异常:
Could not load file or assembly 'netstandard,Version=2.0.0.0,Culture=neutral,PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies.
The system cannot find the file specified.
那么,知道如何解决这个问题吗?
解决方法
以管理员身份执行一次,然后工作!
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。