I've having trouble scheduling the the quote updates using the instructions provided. I'm using Windows 10. I'm trying to get UpdatePSData.bat working first. It's in the PSDataExtract folder. When I run the task with start in argument provided, I get a task scheduler error "The directory name is invalid". If I remove the start in argument, I get last run result in scheduler of (0x1). So in trying to debug, I changed general task scheduler settings from run whether logged in or not to run only when user is logged on. That also gives me directory invalid error. But now if I keep that setting but remove the start in folder argument, the batch job actually runs now, but with just a bunch of failures trying to find the script files.
Any idea how to resolve this? It seems the start in argument is required, but I cannot get the batch job to run with it in place.
C:\WINDOWS\system32>echo off
.\Scripts\GetQuotes-Yahoo.ps1 : The term '.\Scripts\GetQuotes-Yahoo.ps1' is not recognized as the name of a cmdlet,
function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the
path is correct and try again.
At line:1 char:1
+ .\Scripts\GetQuotes-Yahoo.ps1
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (.\Scripts\GetQuotes-Yahoo.ps1:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
.\Scripts\GetQuotes-YahooIntraday.ps1 : The term '.\Scripts\GetQuotes-YahooIntraday.ps1' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included,
verify that the path is correct and try again.
At line:1 char:1
+ .\Scripts\GetQuotes-YahooIntraday.ps1
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (.\Scripts\GetQuotes-YahooIntraday.ps1:String) [], CommandNotFoundExcept ion
+ FullyQualifiedErrorId : CommandNotFoundException
.\Scripts\GetQuotes-AlphaVantage.ps1 : The term '.\Scripts\GetQuotes-AlphaVantage.ps1' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included,
verify that the path is correct and try again.
At line:1 char:1
+ .\Scripts\GetQuotes-AlphaVantage.ps1
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (.\Scripts\GetQuotes-AlphaVantage.ps1:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
Comments
Can you please go into the Scheduler Actions window, select your action, click "Edit..." and then make sure you specify "Start in (optional):" your folder name, for example:
C:\PortfolioSlicer\PSDataExtract
And just to be sure - that is the folder where you .bat files are located and where is a subfolder Scripts with all PowerShell scripts.