Posh-SSH icon indicating copy to clipboard operation
Posh-SSH copied to clipboard

'Get-SFTPFile' does not exists in v3.0

Open ndinev opened this issue 4 years ago • 6 comments

Trying to use it returns: CommandNotFoundException: The term 'Get-SFTPFile' is not recognized as the name of a cmdlet, function, script file, or operable program.

Note: Worked fine in 2.3

ndinev avatar Sep 01 '21 08:09 ndinev

That commqnd was replaced by get-sftpitem. Replaced commands are in the changelig.md

Sent from my iPhone

On Sep 1, 2021, at 4:00 AM, Neven Dinev @.***> wrote:

 Trying to use it returns: CommandNotFoundException: The term 'Get-SFTPFile' is not recognized as the name of a cmdlet, function, script file, or operable program.

Note: Worked fine in 2.3

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.

darkoperator avatar Sep 01 '21 08:09 darkoperator

Thanks, I will try it

ndinev avatar Sep 01 '21 10:09 ndinev

This has impacted a few of our scripts for SCP. Some systems will only have 2.3.0 installed not 3.0.0. which I'm ok with. I can update the scripts to use Get-SCPItem, but how can I prevent the script from running if 3.0.0 not installed on the system?

virtuallywired avatar Jan 11 '22 05:01 virtuallywired

as far I remember XXX-SCPItem already exists in v2.2 but you always can test module version

(Get-Module Posh-SSH -List).Version

MVKozlov avatar Jan 11 '22 06:01 MVKozlov

Max nailed it :) that would be the best way to check

Sent from my iPhone

On Jan 11, 2022, at 2:35 AM, Max Kozlov @.***> wrote:

 as far I remember XXX-SCPItem already exists in v2.2 but you always can test module version

(Get-Module Posh-SSH -List).Version — Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android. You are receiving this because you commented.

darkoperator avatar Jan 11 '22 10:01 darkoperator

Actually didn't realise scpitem was in the older module. That's totally fine then. Thanks for The quick responses.

virtuallywired avatar Jan 11 '22 13:01 virtuallywired