Forum Discussion
PoorMens_Bravo
Aug 01, 2021Brass Contributor
Create a task scheduler that triggers a task if a csv file is created
Hi All, Many thanks in advance, I have a powershell script that runs based on an input csv file. I have to run the script once a csv file is created, kindly help me by letting me know hos to trigger...
- Aug 01, 2021
PoorMens_Bravo Personally, I would add to the PowerShell code a check for the existence of the CSV file(s) and progress only if it exists, otherwise quit. You would then also need to set the task to run more frequently.
if (Test-Path -Path C:\SomeFileName.csv -PathType Leaf){"found, do something"}Else{"quit"}
Apologies if I misunderstood requirements.
CLCCW
Aug 01, 2021Copper Contributor
PoorMens_Bravo Personally, I would add to the PowerShell code a check for the existence of the CSV file(s) and progress only if it exists, otherwise quit. You would then also need to set the task to run more frequently.
if (Test-Path -Path C:\SomeFileName.csv -PathType Leaf){"found, do something"}Else{"quit"}
Apologies if I misunderstood requirements.
PoorMens_Bravo
Aug 02, 2021Brass Contributor
Hi CLCCW,
Thanks for the suggestion, I thought about this idea initially, but, was worried about the after effects, like what about the load on the server of these repeated tasks??
Thanks for the suggestion, I thought about this idea initially, but, was worried about the after effects, like what about the load on the server of these repeated tasks??