-
-
Notifications
You must be signed in to change notification settings - Fork 585
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
VERBOSE: Task Scheduler broken or removed from Windows. #561
Comments
You mustn't change any code if you do not understand why you encounter with this error.
"Very" informative. No ((
Because, firstly, the new version is not buggy, neither the old one does. Secondly, this is not a script issue, but a Windows one (really)! Let's check $Action = New-ScheduledTaskAction -Execute powershell.exe
$Settings = New-ScheduledTaskSettingsSet -Compatibility Win8 -StartWhenAvailable
$Principal = New-ScheduledTaskPrincipal -UserId $env:USERNAME -RunLevel Highest
$Parameters = @{
TaskName = "SophiaTempScheduledTask"
Principal = $Principal
Action = $Action
Settings = $Settings
}
Register-ScheduledTask @Parameters -Force -ErrorAction Stop Run this code as admin, and let's see whether a temp schedule task will be created. The problem is in Windows username I guess. I encounter 3 time with such issue. No workaround we have found. Just something goes wrong, and Windows is unable to create a simliest task. That's all we know. I mean, try to re-install or something else, but the script won't work for your, that's why I put an exception, and you tried to bypass it for the unknwon reason.
Instead of just asking me by any way... |
|
I did understand (after a while), that's why I changed it. It registers a temporary scheduled task just to check if there's any issues with it and if it detects it has issues then it will stop the entire script (which is not really a good solution because the task scheluder only being used with
What? I'm serious here, I have no more information other then before running the script I could rename folders on my PC and after running the script and restarting the PC I couldn't rename folders anymore, Windows would error saying "the path doesn't exist".
Forget that code, something is wrong with this specific code and I don't want to debug it now after the long time I already tried to....
Well, it was a fresh install of Windows so.... I had no really way of communicating, so all I did was try a fresh install after a fresh install after a fresh install (hoping this would solve the issue because I really did start to believe my Windows install is broken - which is not). |
Here, tested this bit:
working fine without:
and without:
|
Another thing to note, I have a script that will rename my PC to the username, exactly the variable you are using!
The issue is with |
So you might argue that you want the
Use
|
You didn't run it. The script was terminated. Also, there's no such code to break anything, This is not the script fault at all. |
I'm testing it now, I will update you on any progress. In the meantime I found a solution for the This has fixed my issues with task scheduler. |
You mustn't use a built-in group, but $env:USERNAME only. so this is not a workaround unfortunately
Will check on Sunday. |
Can you explain why? |
I have tested it a bit more now and I have some additional information to share with you. Fresh Install of Windows (after Windows Updates).
So first of all - just to show there is the downloads user folder visible: Second - just to show I created a new folder and renamed it Test folder in desktop: Third - Run powershell as admin and run only the selected lines: Downloads folder still visible: And can't rename the Test folder: Conclusion: function |
🤔 |
What? |
Thinking out how to fix) |
Same, even though I hope there are other solutions.
|
|
Why though?
That's true, but also kind of... ignoring the issue? |
But hey... at least now you know why some users have issues with task scheduler and some users don't have issues :) |
Once again how to repro the issue on a VM? My pal a year ago didn't rename his PC, as I understodd you correctly. :) |
The command is in the screenshot in one of the reply above, |
Confirm. WTF |
Due to many functions uses |
HAHAHHAA LOL, indeed "WTF" Regarding the issue opened - wow I did not know there was a github page for powershell, nice to know. don't know what's the ETA for a fix tho... also don't know about when Win10 will get the updated fix (before win11 or at the same time?), so we'll see..,
As far as I remember - only the first check (this reported issue) and the 4 scheduled tasks (clean up tasks) are using it. |
Works fine. |
I will test) |
Prerequisites
Steps to reproduce
This is a fresh install of Windows after installing all updates from windows updates.
Versions 5.18.1 and 5.18.2 are buggy.
I have tried overriding the
Task Scheduler broken
issue by using the following command:And I couldn't renamed folders on my PC anymore.
Version 5.18.0 is working, but only if I override the version check by using the following command:
Which is another issue by itself - if the newer version is buggy, why can't I use older version?
Took my 2 days to diagnose this issue.
Windows Version
Windows 10 Iot Enterprise LTSC 2021
Sophia Script version
5.18.2
The text was updated successfully, but these errors were encountered: