I am trying to trigger a sql agent job from a powershell script and I want to add powershell script and add it to task scheduler. Here is where I am stuck.All I am trying to do is check if a new file exists at a specified location. if yes then execute a sql agent job else let me know file not exists
Import-Csv .\*.csv | ForEach { If (Test-Path -Path $_.File) {
--how do I trigger the sqlagent job } Else { Write-Output "No CSV file does NOT exist" } }