Questions tagged [posh-ssh]
28 questions
8
votes
1 answer
Provide private key passhprase (password) for Posh-SSH New-SSHSession
With Posh-SSH, is there a way to provide the passphrase/password to use with an encrypted private key? (Password for the key file, not credentials for the SSH server connection)
I'm having no luck finding information on how to do it, or if it's even…

techie007
- 737
- 1
- 10
- 30
2
votes
1 answer
Remotely login to Linux using New-SshSession in PowerShell (with a private key) fails with "Invalid private key file"
Am trying to log on to Linux servers from Windows PowerShell using a key with the 3 inputs listed below.
New-SshSession -ComputerName [name] Username- [user] -KeyFile [path]
I've been sent the text for a private key from a colleague and need to…

beatsandbosons
- 39
- 1
- 10
1
vote
3 answers
Extract file names from Posh-SSH Get-SFTPChildItem output in PowerShell
I want to take this part
REGISTRATION_ELI_20221222_071008.csv
from this PowerShell output of Posh-SSH Get-SFTPChildItem
Name REGISTRATION_ELI_20221222_071008.csv, Length 0, User ID 1142,
Group ID 1220, Accessed 12/21/2022 3:00:47 PM, Modified…

TITANIXX
- 35
- 6
1
vote
1 answer
Sort file in SFTP based on datetime using PowerShell
I have multiple files in the SFTP folder that were created at the same time but at different dates in their filenames.
Example file:
REGISTRATION_ELI_20210422_071008.csv
REGISTRATION_ELI_20210421_071303.csv
REGISTRATION_ELI_20210420_071104.csv
I…

TITANIXX
- 35
- 6
1
vote
1 answer
Powershell is cutting off long output when connected to a terminal via SSH
To put some context, I use the Posh SSH module to connect to linux machines on other servers and invoke command to get information of the current health of the machine.
When I use the command :
Invoke-SSHCommand -Index 0 -Command "vm_manage.sh…

su7
- 66
- 1
- 7
1
vote
1 answer
How use character '$' in a Invoke-SSHCommand without error
I try to get information from a Linux server in a powershell script
I use the Windows forms and i get the informations in a RichTextBox.
There is no problem for some basic commands.
Example :
$infoversion = Invoke-SSHCommand -Index 0 -Command "uname…

Kroups
- 13
- 2
1
vote
1 answer
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…

Giuseppe Lolli
- 167
- 4
- 15
1
vote
4 answers
Does Posh-ssh not work with windows Task Scheduler
Been trying to connect to an sftp using posh-ssh. Works fine when i run it, when i try running it through windows task scheduler it does not work.
I have tried switching around the users that are to run the script such as Admin, myself, system,…

Adlis
- 95
- 1
- 11
1
vote
0 answers
Powershell posh-ssh and cisco
I am having some issues getting command to work with posh-ssh and Cisco gear.
Commands are pretty simple;
New-SSHSession -ComputerName 10.10.101.240 -Port 22
Will connect fine, and will give me an ID.
I then try
Invoke-SSHCommand -SessionId 0…

markdem
- 51
- 1
- 8
1
vote
1 answer
Reboot Linux Device via Posh-SSH
I am trying to reboot Linux machine from PowerShell script running on Windows 10.
I use Posh-SSH module. All other commands I send via SSH session work fine, but reboot has no effect no matter what I tried.
Via regular SSH client session (Putty or…

Alex Michel
- 416
- 3
- 13
0
votes
0 answers
Permission denied (keyboard-interactive) error in powershell
using powershell posh-ssh , when i try this
Approach A
$session = New-SSHSession -ComputerName $Server -Credential Get-Credential
i get this error
New-SSHSession: Permission denied (keyboard-interactive).
when i tried
Approach B
$cred =…

user21974114
- 1
- 1
0
votes
0 answers
how do I modify CSV column header names Using powershell on an SFTP Server?
I have the below code written up, I am just curious if I am on the right track or if there is a better way to do this sorta thing in a more programmatic way ?
I am wanting to automate the removal of backslashes in the CSV file header names. so…
0
votes
0 answers
Posh-SSH script on Cisco devices
I made a Posh-SSH based script that will let me send commands to Cisco routers. It works great... except for a very specific case.
function Send-SSHCommand {
Param(
[Parameter(Mandatory=$true)]
[String]$Command,
…

MKANET
- 573
- 6
- 27
- 51
0
votes
1 answer
Posh-SSH is giving an error when in WorkFlow
I wrote a script to export rows from a SQL DB, encrypt them using PGP, then transfer them using POSH-SSH v2.3.0. It all works fine, until I put it in a PowerShell WorkFlow to run multiple at a time.
This particular line is the issue:
Set-SFTPFile…

alexander7567
- 665
- 13
- 35
0
votes
1 answer
Attempting to automate a task from Windows to Linux (BusyBox) Console that requires user interaction for termination
I have a Powershell script that will automatically SSH to a Linux host (ESXI Server running Busybox) and will run a singular command (./my_script.sh), which captures some network traffic on the ESXI server. However, this script waits for user input…

a_polo
- 1
- 4