# Password Prompt

**URL:** <https://forums.powershell.org/t/password-prompt/8196>\
**Category:** PowerShell Help\
**Created:** [March 9, 2017, 3:59am UTC](https://forums.powershell.org/t/password-prompt/8196 "2017-03-09T03:59:36Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dr223](https://avatars.discourse-cdn.com/v4/letter/d/ac91a4/32.png) [@dr223](https://forums.powershell.org/u/dr223)\
**Post date:** [March 9, 2017, 3:59am UTC](https://forums.powershell.org/t/password-prompt/8196/1 "2017-03-09T03:59:36Z")

</div>

Hi,

I have a powershell script that works OK - however, the WinSCP requests password re-entering after couple of hours. When this happens the powershell script stops and the transfer of files is terminated.

I want to the script to continue when the password is prompted by WinSCP - How can I achieve that in the code?

Thanks

---

<div class="post-metadata">

**Author:** ![donj](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/donj/32/137_2.png) [@donj](https://forums.powershell.org/u/donj)\
**Post date:** [March 10, 2017, 10:21am UTC](https://forums.powershell.org/t/password-prompt/8196/2 "2017-03-10T10:21:53Z")

</div>

Your script would need to trap that error condition and re-submit the password.

---

<div class="post-metadata">

**Author:** ![dotnVo](https://avatars.discourse-cdn.com/v4/letter/d/4af34b/32.png) [@dotnVo](https://forums.powershell.org/u/dotnVo)\
**Post date:** [May 16, 2024, 8:39pm UTC](https://forums.powershell.org/t/password-prompt/8196/3 "2024-05-16T20:39:08Z")

</div>

Closed on May 16, 2024, 8:39pm UTC


