I had a script that needed to run as an administrator but ensuite run a single command in a non-elevated context. J'étais previously doing it avec runas /trustlevel:0x20000 program.exe, but après updating Windows 11 to 22H2 the command maintenant gives the following output (running Notepad ici as an example):
`PS > runas /trustlevel:0x20000 notepad
RUNAS ERROR: Unable to run - notepad
87: The parameter is incorrect.
I've double-checked the trustlevel argument value and it appears to be correct:
`PS > runas /showtrustlevels
The following trust levels are available on your system:
0x20000 (Basic User)
Cela se produit for any app I try, not just Notepad or the one in my script. I've également tried it in Powershell 7, Windows Powershell (5) and depuis le ligne de commande, but no difference. Runas itself n'est pas completely broken, as Je peux do runas /profile /env /user:<username> notepad and it'll launch (après entering my mot de passe). I've également done an sfc /scannow just in case, but c'est made no difference.
I'm actuellement trying to work out if there's anything Je peux do ici or si le fonctionnalité has just been deprecated in 22H2.