I used the below command to copy file from my win machine to one of the linux machine.
Set-SCPFile -ComputerName 'xx.xx.xx.xx' -Credential $oCredential -LocalFile "D:\UserAccountDetails.zip" -RemotePath '/root/Scripts/' -ConnectionTimeout 30
now i need to copy some of the file from the linux machine to another linux machine using powershell.
Please need help/suggestion on this.
Windows PowerShell 5x has far more available cmdlets and modules than PowerShell Core 6x (Win/Linux / Mac), that is obviously changing over time.
You need to ensure you are always up to date with PS6 on your systems of course to have the latest and greatest and on PS6 for Windows make sure you add the compatibility pack.
This Set-SCPFile cmdlet is Windows only, on Linux/OSX, you have ftp, mount_ftp, sftp and tftp for you to use.
Across all PowerShell versions you always have Copy-Item to use for copying files from source to destination. You can also use SSH with PS6 between Linux systems.
I am using Set-SCPFile for coping...but need something which will help me to copy from Linux to Linux from powershell..Will Set-SCPFile work here ...??
As noted in my previous response, that cmdlet is not part of PSCore, which is what runs on Linux / OSX. You are going to have to use PowerShell SSH and standard Linux commands, and or look at the available modules on powershellgallery.com. However, scp/cp is native to Linux system in distros, why not just use it?