Get-SCPItem warning message when use -f #633
Replies: 1 comment 1 reply
|
Thanks for the report; a couple of things are going on here. -Force on Get-SCPItem currently does double duty: it's inherited from the connection base class, where it means "skip host key verification", and it's also what allows overwriting an existing destination file. So depending on your command, you may be seeing either of two warnings:
Could you paste the exact warning text, your exact command line, $PSVersionTable.PSVersion, and (Get-Module Posh-SSH).Version? Both are plain WriteWarning calls on the pipeline thread, so -WarningAction SilentlyContinue should suppress them, if it isn't, I'd like to know what's different in your environment (PS7 Windows-compat mode and wrapper functions are the usual culprits). Two things that may help in the meantime:
Longer term I agree an explicit overwrite request shouldn't produce a warning at all. I'm tracking that as a fix. |
Uh oh!
There was an error while loading. Please reload this page.
Hi, is there a way to not show the warning message when using the -f switch?
I have tried -warningaction and 3>$null
It still shows.
I need to over -write the existing file.
Thank you
All reactions