darkoperator / darkoperator/Posh-SSH
Assembly with same name is already loaded
Nobody has claimed this yet.
- Dominant language
- PowerShell
- Stars
- 1.1k
- Forks
- 222
- PR merge metrics
- No merged PRs in 30d
Description
Since updating to 3.2.4 we often see this error:
The 'New-SFTPSession' command was found in the module 'Posh-SSH', but the module could not be loaded due to the following error: [Assembly with same name is already loaded] For more information, run 'Import-Module Posh-SSH'.
We run code in parallel:
@('path1','path2','path3') | ForEach-Object -Parallel {
New-SFTPSession -ComputerName 'PC1' -Credential $cred
}
This happens quite often. Is there something we're missing?
We never use Import-Module and rely on auto loading of modules.
This happens on PowerShell 7.4.5. We had to revert back to 3.2.1 where we don't have this issue.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the reported ForEach-Object -Parallel example on PowerShell 7.4.5 with Posh-SSH 3.2.4, then compare it with 3.2.1. Investigate the auto-loading failure involving the assembly with the same name; done means the parallel SFTP-session scenario no longer produces the module-load error, with the affected versions and behavior documented.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- powershell
- Domain
- cli, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100