Hi ... I solved it!
Lol was ez
I've just needed put my script to run after close the WINSCP connection:
Example:
Lol was ez
I've just needed put my script to run after close the WINSCP connection:
Example:
}
finally
{
# Disconnect, clean up
$session.Dispose()
}
Start-Sleep -s 15
Get-Childitem -r -path "G:\SFTP\*******\" | rename-item -newname { [io.path]::ChangeExtension($_.name, "gpg") }
Start-Sleep -s 10
Get-ChildItem -Path "G:\SFTP\******\" -Recurse -Include *.gpg | Move-Item -Destination "G:\SFTP\*****" -verbose
exit 0
}
catch [Exception]
{
Write-Host ("Error: {0}" -f $_.Exception.Message)
exit 1
}