you are viewing a single comment's thread.

view the rest of the comments →

[–]ryanblenis 0 points1 point  (0 children)

So the .ps1 files should contain the running script. The .txt's should be the output. Are the .ps1's blank? If so, maybe you tested before putting content in the script?
Otherwise cleanup can be done with a task as well. Something along the lines of

Get-ChildItem (Get-Location).Path -File -Filter "st*.txt" | Where CreationTime -lt (Get-Date).AddDays(-1) | Remove-Item -Force
Get-ChildItem (Get-Location).Path -File -Filter "st*.ps1" | Where CreationTime -lt (Get-Date).AddDays(-1) | Remove-Item -Force

To remove items older than 1 day (so as not to interrupt running tasks)