I have a powershell api script that changing wifi passwords in Meraki.
Now i want to add this script to Task Scheduler and execute it with a specific command line, for example:
In “Action” section i’m always putting those lines:
When you post code, error messages, sample data or console output format it as code, please.
In the “Text” view you can use the code tags “PRE”, in the “Visual” view you can use the format template “Preformatted”. You can go back edit your post and fix the formatting - you don’t have to create a new one.
Thanks in advance.
To circumvent such problems I’d recommend using config or settings files instead of command line parameters. Then you even do not need to change the scheduled task if you want to change the behaviour of the script.
Instead of providing command line parameters to control the behaviour of a script you save the needed setting in a text file next to the script file and in your script you read this settings file to get the contained settings. To make it easy to handle and easy to set up you should use a standardized format like JSON or a powershell data file. I like to use the latter one because it’s easy to write and easy to use.