But why the multiple scripts, just automate it all in one place,
One script, one scheduled task.
FYI, those who are not aware, this key does not exist by default,
hence using the New and Remove cmdlets.

### Begin: A small rant though ###
###

First, why do folks keep suggesting using Notepad and o the non-powershell
capable editors to write PowerShell scripts, when the built-in PowerShell_ISE
Is a far better and more intelligent tool for this kind of this.

You , write, test, debug in a single tool. You cannot do this in non PowerShell
capable editors like Notepad of course, so why go there at all.

If one does not like the PowerShell _ISE, for whatever reason, then
VisualStudioCode, should be the next time of choice.

Both avoids all the separate tool / copy and paste from notepad or whatever
back into PowerShell craziness to make scripts, functions, and modules.

Then of course there are the paid for enterprise PowerShell IDE, like Sapien's
PowerShell Studio and others free ones like Idera's PowerShellPlus, or even
Visual Studio Community edition with PowerShell add-ons. Yet these might be
overkill for many IT pros.

Drop the Notepad stuff, and user VSCode (super notepad for PowerShell and more).
Or just use the built-In PowerShell_ISE.

I know, I know, old habits are hard to break. Well, that, and folks will have their preferences.

###
### End: A small rant ###

Example - performing all build, edit, test, validate all in Visual Studio Code
You have an intelligent editor to help you along the way with full IntelliSense,
debug and test it live before you set you Task Schedule.

Last point, once tested you can create that task schedule item using PowerShell directly