Skip to content

Instantly share code, notes, and snippets.

@rosshiga
Created July 6, 2021 03:27
Show Gist options
  • Select an option

  • Save rosshiga/c0291721e00ad9c8868228db23113bf3 to your computer and use it in GitHub Desktop.

Select an option

Save rosshiga/c0291721e00ad9c8868228db23113bf3 to your computer and use it in GitHub Desktop.
Powershell Watch Folder Trigger
# Waits for CSOR App to push a text file to directory then runs BR Data SQL export
while( $true )
{
if( (Get-ChildItem C:\Brdata\CSHOST\auto\*.txt | Measure-Object).Count -eq 1){
Start-Process -FilePath "C:\Brdata\plbwin.exe" -ArgumentList "brsqlexp autocmd numdays=5 DSDDET DSDHDR"
}
Remove-Item 'C:\Brdata\CSHOST\auto\*' -Include *.txt
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment