Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Load WinSCP .NET assembly
- Add-Type -Path "WinSCPnet.dll"
- # Declare variables
- $date = Get-Date
- $dateStr = $date.ToString("yyyyMMdd")
- #$fileDirectory = "\abicfs2appsCoverageVerifier"
- #$filePath = "\abicfs2appsCoverageVerifiercvgver." + $dateStr + ".0101"
- $filePath = "\empqaapp1coverageverifier_scriptsCoverageVerifiercvgver.20190121.0101"
- # Write-Output $filePath
- # Set up session options
- $sessionOptions = New-Object WinSCP.SessionOptions -Property @{
- Protocol = [WinSCP.Protocol]::Sftp
- HostName = "secureftp.iso.com"
- UserName = "account"
- Password = "password"
- SshHostKeyFingerprint = "ssh-rsa 2048 8C1lwAjxCNRF6B4kbPIeW52/GB+98FmLMt0AJNf/Sf4="
- }
- #$sessionOptions.AddRawSettings("FSProtocol", "2")
- $session = New-Object WinSCP.Session
- # $session.SessionLogPath = "\shareappsCoverageVerifierUploadLog.log"
- try
- {
- # Connect
- $session.Open($sessionOptions)
- # Transfer files
- $session.PutFiles($filePath,"/").Check()
- }
- finally
- {
- $session.Dispose()
- }
Add Comment
Please, Sign In to add comment