简体   繁体   中英

Could not load file or assembly - Powershell

I'm trying to use the Posh-SSH module in Powershell to send a file trough an SFTP.

However, I just install the module with administrator right in powershell using this command:

Install-Module Posh-SSH -Force
iex (New-Object Net.WebClient).DownloadString("https://gist.github.com/darkoperator/6152630/raw/c67de4f7cd780ba367cccbc2593f38d18ce6df89/instposhsshdev")

But, when i run the Powershell ISE without administrator rights and I call my script the next exception appears:

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'.

As suggested by Powershell, I've added the command "Import-Module Posh-SSH" but another exception appears:

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.

So, any idea how to solve this?

Executed as Administrator one time and then worked!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM