Forum Discussion

PoorMens_Bravo's avatar
PoorMens_Bravo
Brass Contributor
Aug 01, 2021
Solved

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...
  • CLCCW's avatar
    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. 

Resources