Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to run as scheduled task #6

Open
Dacraun opened this issue Feb 20, 2023 · 0 comments
Open

Unable to run as scheduled task #6

Dacraun opened this issue Feb 20, 2023 · 0 comments

Comments

@Dacraun
Copy link

Dacraun commented Feb 20, 2023

Hi there!

I've been searching for a script like yours for a while, and am very happy to have found it.
It does its job quite well when running manually, however I was hoping to keep it running every time I start my computer, as a background task.
However if I so much as create a shortcut to run test.ps1 through powershell, or try and run it through task scheduler then I receive the following error:
(It is French due to the system language, I hope that is not too big an issue)

Running speed test # 1
.\speedtest.exe : Le terme «.\speedtest.exe» n'est pas reconnu comme nom d'applet de commande, fonction, fichier de
script ou programme exécutable. Vérifiez l'orthographe du nom, ou si un chemin d'accès existe, vérifiez que le chemin
d'accès est correct et réessayez.
Au caractère C:\Users\Heart\Downloads\AutomaticOokla\test.ps1:27 : 15
+   $response = .\speedtest.exe --format=json-pretty --unit=Mbps
+               ~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (.\speedtest.exe:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

ConvertFrom-Json : Impossible de lier l'argument au paramètre « InputObject », car il a la valeur Null.
Au caractère C:\Users\Heart\Downloads\AutomaticOokla\test.ps1:28 : 30
+   $responseObj = $response | ConvertFrom-Json
+                              ~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidData : (:) [ConvertFrom-Json], ParameterBindingValidationException
    + FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.ConvertFrom
   JsonCommand

C:\Users\Heart\Downloads\AutomaticOokla\test.ps1 : Error
    + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException
    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,test.ps1

Total tests: 1 (failed 1)
---

It then loops endlessly with this error.
Again, running it manually works just fine, running it through a shortcut or task schedule produces this.
The path is the correct one, I did try setting permissions as administrator on both the shortcut and the scheduled task.
I'm quite unfamiliar with powershell, so I might just be doing something fundamentally wrong. x')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant