web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Looping PowerShell scr...
Power Automate
Unanswered

Looping PowerShell script over list of data from excel leads to stuck flow at PowerShell action.

(0) ShareShare
ReportReport
Posted on by 10

Hi,

Facing an issue with Power automate for desktop. where Looping the PowerShell to move files from One folder to Another based on the file name. during this process the flow got stuck at "Run PowerShell Script" Action without fail.
Here is the Script:

 

$source="%CountryInputFolder%"
$destination="%CountryTempFolder%"
$filter = [regex] "%FilteredCountryName%"
$bin = Get-ChildItem -Recurse -Path $source | Where-Object {$_.Name -match $filter}
Write-Host $bin.Length

 

Its hardly looping over 19 times and stuck there. sometimes it will stuck at first 5 records.
Is there any suggestions or tips to follow?

Thanks in advance.

Pc1.png
PC2.png
I have the same question (0)

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 271 Super User 2026 Season 2

#2
trice602 Profile Picture

trice602 171 Super User 2026 Season 2

#3
11manish Profile Picture

11manish 148 Super User 2026 Season 2

Last 30 days Overall leaderboard