Popular Posts

Jun 26, 2017

putty and scp tools in Windows PowerShell and .bat scripts

         
            - plink a command-line interface to the PuTTY back ends,
            - plink is used in windows powershell or .bat scripts to achieve the putty functionality.
                32-bit: DownLoad
                64-bit: DownLoad


            - pscp an SCP client, i.e. command-line secure file copy
            - pscp  is used in windows powershell or .bat scripts to achieve winscp functionality
                32-bit: DownLoad
                64-bit: DownLoad

1.   Example to execute a script in remote unix server from a windows machine using plink
             plink.exe -t -l judi -pw <password> 10.192.168.10 "/export/home/judi/health.sh >/dev/null 2>&1"

2.   Example to copy some log files from windows machine to a remote unix server using pscp
             pscp.exe -l judi -pw <password> D:\logs\$files 10.192.168.10:/export/home/judi/logs/

3.   Execute the powershell script via .bat
      The above two lines needs to be updated in execute.ps1 and execute.ps1 needs to be called in a .bat file using the below line
             C:\WINDOWS\system32\WindowsPowerShell\v1.0\powershell.exe D:\Scripts\execute.ps1

$date= (Get-Date).ToString("ddMMyyyy")







~Judi~
putty in windows powershell script
winscp in windows powershell script
windows powershell scp

scp from powershell

No comments:

Post a Comment

Popular Posts