H
HASS.Agent•6mo ago
Ellie

command run through powershell not working

i'm trying to run a simple command from here: https://github.com/nathanbabcock/nightlight-cli . i installed it as nodejs, but it seems to run through command line or powershell just fine, but when i try to input the command same as I would there, it doesnt work. i've searched around for a while and haven't been able to figure out anyway to make commands from this work. help figuring this out would be super appreciated
GitHub
GitHub - nathanbabcock/nightlight-cli: Control Windows 10/11's Nigh...
Control Windows 10/11's Night Light feature programmatically 🌓 - nathanbabcock/nightlight-cli
Solution:
Thread closed Issue was with PATH, system needed to be restarted due to changes to PATH...
Jump to solution
26 Replies
Ellie
EllieOP•6mo ago
for the record regular powershell commands seems to run fine, its something with the specific setup here, probably to do with it being nodejs if i had to guess
DrR0x
DrR0x•6mo ago
@Amadeo This command works without admin privileges right?
Amadeo
Amadeo•6mo ago
Does hass.agent produce any kind of logs after the command is executed? (With extended logging)
Ellie
EllieOP•6mo ago
Yep Let me check again in a bit but I didn't see any after I tried earlier today
DrR0x
DrR0x•6mo ago
You could try invoking a shell to run the command and enable the flag to keep it open, might provide info on why it is/isn't working
Ellie
EllieOP•6mo ago
sorry, it's been a while, how do i do that again? 😅
Ellie
EllieOP•6mo ago
actually, am i doing smth wrong here? i was trying to use mqtt to test instead of constantly storing new commands, but this test command does nothing. if i put the command in the "command or script" box instead of sending it as an mqtt payload, it works fine
No description
No description
DrR0x
DrR0x•6mo ago
powershell -Command {your command here} -NoExit Test that in a normal PowerShell and then test it in Hass.agent It should spawn a new window and run command, U may need to specify normal window style if it is hidden by default
Ellie
EllieOP•6mo ago
seems to just run in the same window
No description
DrR0x
DrR0x•6mo ago
Someone on stack overflow used this for npm start powershell {.\scriptInNewPSWindow.ps1} I would try putting your command in the brackets again
Ellie
EllieOP•6mo ago
oh i didnt realize the brackets were part of it, my bad
Ellie
EllieOP•6mo ago
so works fine in powershell but not through hass agent.-NoExit didnt seem to work here but I managed to just record and screenshot the error
No description
Amadeo
Amadeo•6mo ago
does this "nighlight" work everywhere or there is specific folder?
Ellie
EllieOP•6mo ago
Everywhere I've tried so far. Changing the current directory doesn't affect it, and I can just open PowerShell or command prompt and execute it the one command
Amadeo
Amadeo•6mo ago
low integrity is off right? because the error you've captured basically says "I don't know what nightlight is"
Ellie
EllieOP•6mo ago
Should be. I think i tried it both with and without Powers out rn cause of a storm so I can double check when it comes back on whenever that is
Amadeo
Amadeo•6mo ago
worst case scenario I'll ask you to do me a step by step list of what you've configured/done with the nightlight I might try that on a vm
Ellie
EllieOP•6mo ago
ok so yeah it was with low integrity off but i did try both ways, didnt make a difference can detail the steps for you of what i did to get the nightlight thing if you want, it's pretty simple
Amadeo
Amadeo•6mo ago
Yeah, this is the only way for me to check what might be the fault
Ellie
EllieOP•6mo ago
sure, i downloaded nodist from here and ran the exe for v0.10.3 https://github.com/nodists/nodist and then ran the command from the "Getting started (Cli)" section of https://github.com/nathanbabcock/nightlight-cli npm i -g nightlight-cli and thats literally it, then it was working in both powershell and command prompt not like to rush or anything, i know yall have life and stuff, was just wondering if youre looking into this or if i should look to other ways to accomplish this
DrR0x
DrR0x•6mo ago
It will be looked into, I will try and replicate in an hour If we can replicate it a fix should be quick enough, at most a few days
Ellie
EllieOP•6mo ago
ok, thanks, appreciate that ok this this is a little embarassing...i messed around with it a bit more, and the same commands that werent working before are working perfectly fine now. i suspect what happened was that I probably hadn't restarted my computer since installing it, and for some reason it worked fine in command prompt and powershell, but hass agent couldnt recognize it (im not the most technical person 😅 ). At any rate, my issue does seem to be solved now..
DrR0x
DrR0x•6mo ago
Actually this is very likely to be the cause 😂
Ellie
EllieOP•6mo ago
I'm sorry for throwing you guys for a loop lol, appreciate the help nonetheless
DrR0x
DrR0x•6mo ago
The way I'm 99% sure this went down is like this: 1. You installed the package 2. It added to PATH 3. The new PowerShell and CMD prompts used the new PATH 4. HASS.Agent was still on old PATH due to not restarting system 5. Therefore Hass.agent commands used the old PATH without the new tools
Solution
DrR0x
DrR0x•6mo ago
Thread closed Issue was with PATH, system needed to be restarted due to changes to PATH
Want results from more Discord servers?
Add your server