You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a PowerShell script that connects to a tenant and then uses Get-PnPFlow to pull a list of flows in the environment. I am using the latest version of PowerShell 7 (v7.4.3) and the latest nightly version of PnP.PowerShell (v2.5.19). When I run the script from the PowerShell command line it executes perfectly and generates results as expected.
However, I need to run the script as a scheduled task, and so I created a Windows Task Scheduler Task. When I run it under Task Scheduler the script begins executing and connects to the tenant successfully (I can use get-PnPContext and it shows the proper tenant URL). Everything seems good until I make the call
At this point the script seems to hang and eventually throws the error:
There was an error accessing the flow environment [Default-xxxxxxxx-yyyy-yyyy-yyyy-xxxxxxxxxxxx]
The request was canceled due to the configured HttpClient.Timeout of 100 seconds elapsing.
Any thoughts or ideas why the script works perfectly off the command line but then hangs under Task Scheduler?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello,
I have a PowerShell script that connects to a tenant and then uses Get-PnPFlow to pull a list of flows in the environment. I am using the latest version of PowerShell 7 (v7.4.3) and the latest nightly version of PnP.PowerShell (v2.5.19). When I run the script from the PowerShell command line it executes perfectly and generates results as expected.
However, I need to run the script as a scheduled task, and so I created a Windows Task Scheduler Task. When I run it under Task Scheduler the script begins executing and connects to the tenant successfully (I can use get-PnPContext and it shows the proper tenant URL). Everything seems good until I make the call
$flows = Get-PnPFlow -Environment $environmentName
At this point the script seems to hang and eventually throws the error:
There was an error accessing the flow environment [Default-xxxxxxxx-yyyy-yyyy-yyyy-xxxxxxxxxxxx]
The request was canceled due to the configured HttpClient.Timeout of 100 seconds elapsing.
Any thoughts or ideas why the script works perfectly off the command line but then hangs under Task Scheduler?
Thanks
Beta Was this translation helpful? Give feedback.
All reactions