# Ansible get Powershell return slowly

**URL:** <https://forum.ansible.com/t/ansible-get-powershell-return-slowly/5038>\
**Category:** Get Help\
**Tags:** windows\
**Created:** [April 19, 2024, 7:12am UTC](https://forum.ansible.com/t/ansible-get-powershell-return-slowly/5038 "2024-04-19T07:12:42Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hye](https://avatars.discourse-cdn.com/v4/letter/h/45deac/32.png) [@Hye](https://forum.ansible.com/u/Hye)\
**Post date:** [April 19, 2024, 7:12am UTC](https://forum.ansible.com/t/ansible-get-powershell-return-slowly/5038/1 "2024-04-19T07:12:42Z")

</div>

We found ansible running powershell script on windows ,get return slowly or failed.  
Actually the script already finished ,but Ansible can not get return back.

Open SSH version :9.2.0.0

Here is my test time record:  
Start Ansible Task Time：14:32:06  
Script Create Time on Windows：14:32:16  
Script Run start time：14:32:24  
Script Run End time：14:32:35 (which time the txt show “End”)  
After the script run finished , ansible still show running status. it have been running already 1 hours.

- my code  
$j = 10  
$date = get-date -format yyyyMMddHHmmssfff  
$filename = “C:\Users\ScriptTest\_$date.txt”  
echo $date \>\>$filename  
for($i=0;$i -le $j;$i++){  
$now = get-date  
$now \>\>$filename  
sleep 1  
}  
“End” \>\>$filename
