Closed dfrigon closed 5 years ago
And I would be really comfortable to manually enter my credentials when running the script if I need to.
Finally I was looking way to far... I commented the Exit in the if statement of the RequireAdmin Function and it worked.. I think that normally it would open a separate PowerShell application and close de CMD but on my side it seems to be handled in the Command Prompt directly so by keeping it open instead of closing it it works.. is this all normal?
Download a fresh copy of version 3.6 from GitHub releases and add -NoStop
after -NoProfile
in both Default.cmd and Win10.ps1 (line 11). This should cause the PowerShell window to stay open after the script interrupts and allow you to examine the error you're getting.
And I would be really comfortable to manually enter my credentials when running the script if I need to.
That's what the script in cooperation with UAC should already do, depending on your UAC settings. But for some reason it doesn't on your machine.
I commented the Exit in the...
Which means that the script will continue running without elevation. Probably not what you want.
is this all normal?
None of what you describe is :)
Correction: add -NoExit
after -NoProfile
Well it's worse than I expected then!
With the addition of the -NoExit
in both files the Command Prompt stays open with this:
Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.
PS Z:\Desktop\Win10-Initial-Setup-Script-3.6>
The PowerShell window do the same thing as before which is to pop open and close instantly.
Is your Z:\ by any chance a network drive? That would explain a lot of things. Everything, actually :)
When I first tried before opening this issue I was running of the C: drive and it wasn't working (but I figured out I wasn't administrator at this time with the user I had..) so I assumed that running on the Z: with the same issue was in the code but now with all the right autorisations and running on the C: it works!
Thanks a lot for your time!
When I run the Default.cmd it start and ask for PowerShell to allow to make changes but when I click yes I can see the PowerShell pop and close directly and the cmd also closes and none of the functions runs from the Win10.ps1 file.
I bypassed the RequireAdmin function in the Default.preset and now it works fine but I assume any modifications that requires Administration privilege won't work
Any clues? Thanks!