Powershell - VisualCron - Forum

Community forum

We are have numerous powershell scripts running and have had issues with them running correctly in the background. SOmthing such as populating database tables or writting to log files which is most recently. We used the below script to write to a relitive path to a log file and it never populates with new data. But it still does write the log file, just writes incorrectly. If we use a .bat file to run the powershell in visual cron then it runs fine or it runs fine in powershell outside of visual cron. Just seems like Visual Cron need to do some work on powerhsell scripts. The PSScriptRoot is the command in question

$PSScriptRoot + "test" | Tee-Object -Append -FilePath c:\ScheduledApps\jps\Notify\log.txt
$Host | Tee-Object -Append -FilePath c:\ScheduledApps\jps\Notify\log.txt
"after log write" | Tee-Object -Append -FilePath c:\ScheduledApps\jps\Notify\log.txt
Scroll to Top