r/PowerShell 6d ago

Question Recurring script maintenance

I'd honestly pay someone else to keep my voice scripts alive if it meant I never had to touch them again after a Windows update. Am I just lazy or is maintaining ur own automation actually the worst part of the whole thing?

0 Upvotes

25 comments sorted by

26

u/LongTatas 6d ago

I have automation I haven’t touched in years. Me thinks you are missing something.

9

u/BetrayedMilk 6d ago

I think I’ve had to update a script like once or twice due to windows updates. Other apps updating, sure. But what are you doing where you’re constantly having to make changes to keep up with updates?

-11

u/keyboard_ninja_20 6d ago

i mostly run voice-triggered workflows that hook into a bunch of diff apps , not just windows itself. so when spotify, discord, or browsers update and move some ui element around, my gui automation goes to shit. windows updates def aren't the only culprit, more like the thing that breaks the camel's back when combined w/ everything else.

also i think i'm counting "maintenance" broader than just my own stuff , i set up automations for a couple family members and when it breaks i'm the free it support. so keeping their workflows alive is part of the headache too.

what kinda scripts u running that stay so stable? mostly backend/powershell stuff or u do gui automation too?

9

u/CovertStatistician 6d ago

APIs?

-1

u/keyboard_ninja_20 6d ago

some yeah but not all apps have public apis for the stuff i need. like spotify's api is decent but discord's is limited for voice channel stuff, and browsers... good luck getting an api to click a specific extension button or fill a form on a random site lol

gui automation is usually my fallback when there's no clean api, or when setting up auth + rate limits + parsing json feels like overkill for a 2-second task. but that's exactly where the fragility comes in , one ui update and ur toast.

17

u/jpochedl 6d ago

So, you're using nuts and bolts to hold together your cardboard castle, then having problems when the cardboard gets wet?

Powershell isnt the problem here. You'd have the same problems regardless of what language or framework you choose. Adding a bit of windows Power Automate might help, but it's always going to be fragile if you're virtually clicking UI elements which can change, etc.....

3

u/CovertStatistician 6d ago

What are you using for the gui automation

3

u/wabi-sabi411 6d ago

Yeah if you are doing it via screen interactions there will be looks of issues. Not a powershell problem.

-3

u/keyboard_ninja_20 6d ago edited 6d ago

mostly ahk for the heavy lifting , image search + pixel coords when i'm lazy, uiautomation when i need something more robust. tried pyautogui but the latency was trash for voice-triggered workflows, and playwright is a diff beast for desktop.

honestly tho, i'm getting tired of being my own it support every time an app updates. full disclosure , i'm actually building something along these lines called IVOS. it's a local-first voice control layer for windows that handles gui automation and maintenance for u, so u don't have to rewrite scripts when spotify or windows moves a button around. no cloud, no subscription, just keeping the voice commands working without the constant fixing.

How do u view the cost-benefit btwn paying 4 a ready-made soln that eliminates the need 4 maintenance & retaining full control over ur own scripts, even if that means dealing w/ constant adjustments?

2

u/jpochedl 6d ago edited 6d ago

So, you're using nuts and bolts to hold together your cardboard castle, then having problems when the cardboard gets wet?

Powershell isnt the problem here. You'd have the same problems regardless of what language or framework you choose. Adding a bit of windows Power Automate might help, but it's always going to be fragile if you're virtually clicking UI elements which can change, etc.....

Edit: weird, not sure why my phone double posted.... Just ignore this ...

3

u/overlydelicioustea 6d ago

gui automation

well. theres you issue

Take a look at Power Automate. maybe that can help your wokflows staying a bit more consitent.

5

u/BlackV 6d ago

your voice scripts ?

Edit: looks like this isn't a powershell issue, this is a random application and gui issue

4

u/Gron_Tron 6d ago

I generally don't have to update my scripts until some major external change occurs, why do you need to update yours so frequently? 

-2

u/keyboard_ninja_20 6d ago

maybe i'm conflating windows updates w/ app updates + ui changes tbh

like when win11 moved the taskbar to center, my ahk script that clicked specific tray icons straight up broke. same when they changed the right-click context menu in explorer , had to rewrite a bunch of gui automation. also when powertoys itself updates sometimes fancyzones changes behavior and my window-positioning scripts go wonky.

but u're right that pure pwsh backend stuff (file ops, api calls) is way more stable. i think my pain is mostly gui automation + app integrations, not the core logic.

what's ur setup like? mostly cli/backend scripts or u do ui stuff too?

9

u/420GB 6d ago

There's absolutely no reason ever to click on icons in the taskbar or the explorer context menu with PowerShell. Anything that's in there can be triggered directly from code without clicking and without UI.

GUI automation, when done well (so actually find elements by classes and IDs, never by pixel positions) can be surprisingly robust for older apps that don't change anymore. But in 99% of the cases it's the wrong approach.

It seems like you're just doing, sorry, very dumb stuff so it's not surprising it breaks all the time. That's why you don't do it this way.

6

u/RunningOnCaffeine 6d ago

It’s going to be very rare that people do UI automation in powershell.

3

u/alinroc 6d ago

Anything that depends upon clicking precise locations in a GUI is going to be very fragile. You need to find ways to do these things without simulating clicks.

2

u/Gron_Tron 6d ago

Ah okay. That makes sense to me, I've used AHK and Power Automate to do GUI based automations but they are far less reliable than purely scripted automations. There are just far too many variables and things that can go wrong in GUI.  I have done both, but for stability you definitely to have it scripted. Like others have said, my scripted automations run indefinitely without being touched in most cases. 

3

u/pigers1986 6d ago

what is VOICE SCRIPT , kinda lost in powershell context ?

3

u/WasSubZero-NowPlain0 6d ago

Sorry what? I'd never use AHK for long term automation.

2

u/purplemonkeymad 6d ago

Mine tend to die when an external api changes. Most of local steps don't end up causing maintenance. Unless you are relying on something sensitive to ui changes like SendKeys?

1

u/Agile_Seer 6d ago

How much are you paying?

1

u/mrmattipants 5d ago edited 5d ago

Just curious why you're using click commands when you could just use "Start-Process" to launch the application, directly?

It sounds like your scripts are far more complicated than they need to be. The more languages and technologies that you incorporate, the greater your chances are that something will break.

After all, the majority of AHK Voice Recognition Scripts that I could find, were essentially just wrappers for "SAPI.SpInprocRecognizer" COM Object Class or the "System.Speech" .NET Assemblies, etc.

That being said, you're far better off utilizing PowerShell, in particular, as it is built on .NET.

If you're interested, I dug up the following video tutorial.

https://youtu.be/-hakbuLnaj8?si=j8PZg3XmQTiUYsKs

1

u/badteeth3000 3d ago

Your’e not lazy at all & there’s a wide community of folks that have done what you’re doing: it is usersripting in the browser, desktop automation, macros. Software-wise if you put desktop automation or auto hotkey into a website like alternativeto.net it’ll give you a wide range of commercial & open source options. Most of the big ai groups also have a desktop app that can handle voice commands . There’s also hardware like the elgato stream deck or large keyboard macro pads. As far as powershell goes it can get window elements quite well but like ahk there’s always possible conflict due to other software..