Code: Alles auswählen
[Actions]
DefVar $biossetting$
DefVar $biossettingvalue$
DefVar $password$
DefVar $exitcode$
Set $biossetting$ = GetProductProperty("biossetting","WakeOnLan")
Set $biossettingvalue$ = GetProductProperty("value","Enable")
Message "changing BIOS settings...."
DosInAnIcon_set_policy
ExecWith_powershell "%SYSTEM%\WindowsPowerShell\v1.0\powershell.exe" winst /sysnative
Set $exitcode$ = getlastexitcode
LogError $exitcode$
if ($exitcode$ = "540")
sub "%SCRIPTPATH%\t540.opsiscript"
endif
if ($exitcode$ = "560")
sub "%SCRIPTPATH%\t560.opsiscript"
endif
[ExecWith_powershell]
$system = Get-WMIObject Win32_Computersystem SystemFamily | Select-Object SystemFamily
if ($system.SystemFamily -eq "ThinkPad T540p"){
exit 540
}
if ($system.SystemFamily -eq "ThinkPad T560"){
exit 560
}
[DosInAnIcon_set_policy]
echo "powershell set-executionpolicy RemoteSigned ..."
powershell.exe set-executionpolicy RemoteSigned
exit %ERRORLEVEL%
Wenn ich das per opsi ausführen lasse, kommt als Exitcode 1, statt 540.
[Edit: winst /sysnative geändert]