How to Keep My PowerShell Script Running Smoothly?

0
13
Asked By CuriousCat123 On

I'm handling some sys-admin tasks in a small business and need a reliable solution to record a voice signature during web application use. I've got a PowerShell script that tracks a specific title bar in Edge, records audio using ffmpeg, then encrypts it with gnupg and uploads it via curl. The issue is that the script isn't very stable. I've tried using startup items and Task Scheduler, but they don't trigger reliably and sometimes spawn multiple instances. Closing the laptop lid often causes hangs while ffmpeg is running. I'm considering alternatives like creating a service, but I'm not experienced with that. Is there a safer way to maintain this script on Windows 11?

5 Answers

Answered By NinjaScripter On

You could try using NSSM to run your script as a service. It can handle restarting if things go awry. Just make sure it’s compatible with Windows 11.

CuriousCat123 -

Is NSSM safe to use with Windows 11? It seems like it hasn't been updated in a while.

Answered By SimpleSolutions On

Instead of a script, maybe a small C# application running as a service would work better long-term? It could provide you with more reliability.

CuriousCat123 -

That definitely seems like a more stable option, but I’m not a programmer and PowerShell felt easier to pick up.

Answered By TechWizard9 On

It seems like this could be handled better through web development rather than a script. Have you considered a solution integrated within the web app itself?

SmallBizDev -

We can't modify the provided web app since it’s hosted by the carrier.

Answered By DevSavant42 On

If they don't understand sysadmin roles, then suggest they hire a developer. Sysadmins typically handle system stability, not heavy programming tasks like this one.

CuriousCat123 -

I get that, but for a small family business, it's tricky to find those resources.

BeingPractical -

This is exactly the issue here; small businesses often lean on sysadmins for development work.

Answered By CSharpNinja On

Creating a service is pretty straightforward if you know a bit of C#. Here's a template to help you set it up... Just grab the script from GitHub at startup!

CuriousCat123 -

Nice! Could a service handle expanding the WindowTitle from a user’s application?

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.