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

Notifications

Announcements

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.

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard