Run Tasks on Timers in PowerShell
Video Statistics and Information
Channel: Trevor Sullivan
Views: 3,839
Rating: undefined out of 5
Keywords:
Id: 8dZbdl3wzW8
Channel Id: undefined
Length: 17min 8sec (1028 seconds)
Published: Sat Dec 12 2020
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.
Great video!
One thing that was nice to learn is how to see constructor overloads:
Cool, there are times I cant set a scheduled task on a server and having it be contained in the script would be easier
Hey folks, my latest video covers the topic of creating timer-based tasks in PowerShell. Please let me know what you think of this topic, and share something useful you've created with this concept! I'd love to hear what interesting applications you've discovered for PowerShell. π»
Why not use Task Scheduler?
Thanks, this seems like it will be very useful!
Excellent video. I finally learned how to subscribe to a YouTube video!! Thanks for that!!
Great training, as always.
It seems PS is updating so fast, it seems hard to stay up to date at times. How do you do it?
You shaved the beard!?
I'm sure there are some use cases where this might be needed, and the video does a good job at explaining how to do it.
But anytime you are reaching into the clr to make use of a timer in a powershell script, I have to think, you need to reevaluate if what you are doing needs to be a powershell script.
Just because you can, doesn't mean you should, something like this should be a windows service or utility, and in the example provided one should likely make use of a directory watcher, and trigger in changes, and not do checks on a timing interval.
As a rule of thumb I would not recommend making use of objects that require disposing in powershell, there are way too many ways that script can be terminated and you end up on probably disposing of the unmanaged resources that object maybe using.
If you are going to use the CLR like this, I would recommending learning. .Net or specifically c#