Ich kopiere mir ein beliebiges Beispiel aus der Doku und führe das im WInst aus, die ersten Versuche klappen auch bislang - aber irgendwann, offenbar nachdem irgendwas relevantes verändert wurde, stoße ich immer wieder auf folgenden Fehler:
Code: Alles auswählen
[1] [Mrz 29 17:15:15:866] DEU - System default locale
[6] [Mrz 29 17:15:15:869] Registry key [HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion] opened
[6] [Mrz 29 17:15:15:872] Key closed
[1] [Mrz 29 17:15:15:875] MS Windows 10.0 64 Bit, Release: 1607, Edition: Windows Enterprise 2015 LTSB
[1] [Mrz 29 17:15:15:879]
[6] [Mrz 29 17:15:15:883] Registry key [HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion] opened
[6] [Mrz 29 17:15:15:886] Key closed
[6] [Mrz 29 17:15:15:938] LogLevel was 6
[6] [Mrz 29 17:15:15:941] LogLevel set to 9
[9] [Mrz 29 17:15:15:946] Parsingprogress: r: DefVar $value$ exp: SetLogLevel
[9] [Mrz 29 17:15:15:949] Parsingprogress: r: $value$ exp: DefVar
[9] [Mrz 29 17:15:15:953] Parsingprogress: r: DefFunc test($str1$:string):string exp: $value$
[9] [Mrz 29 17:15:15:955] Parsingprogress: r: test($str1$:string):string exp: DefFunc
[8] [Mrz 29 17:15:15:958] Found new defined function name: test
[8] [Mrz 29 17:15:15:963] Found defined function parametername: $str1$
[8] [Mrz 29 17:15:15:966] Parameter has call type: val
[8] [Mrz 29 17:15:15:971] Parameter has valid data type: string
[8] [Mrz 29 17:15:15:974] Function has valid data type: string
[6] [Mrz 29 17:15:15:978] Added defined function:: test to the known functions
[9] [Mrz 29 17:15:15:982] Parsingprogress: r: Set $value$ = test("bla") exp: EndFunc
[9] [Mrz 29 17:15:15:987] Parsingprogress: r: $value$ = test("bla") exp: Set
[6] [Mrz 29 17:15:15:998] Set $value$ = test("bla")
[8] [Mrz 29 17:15:16:009] We are coming from function with index: -1 (-1 = base)
[8] [Mrz 29 17:15:16:020] We enter the defined function: test with 1 lines. inDefFuncLevel: 7
[8] [Mrz 29 17:15:16:030] Paramnr: 0 is : "bla"
[8] [Mrz 29 17:15:16:040] Paramnr: 0 is the string: bla
[9] [Mrz 29 17:15:16:051] Parsingprogress: r: Set $result$=$str1$+"extra" exp:
[9] [Mrz 29 17:15:16:060] Parsingprogress: r: $result$=$str1$+"extra" exp: Set
[6] [Mrz 29 17:15:16:071] Set $result$=$str1$+"extra"
[2] [Mrz 29 17:15:16:082] Syntax Error in Section: (Command in line 1 origin: C:\tmp\test.opsiscript line: 2): $result$=$str1$+"extra" -> Unknown variable name: $result$
[8] [Mrz 29 17:15:16:091] We leave the defined function: test ; inDefFuncLevel: 6
[6] [Mrz 29 17:15:16:101] The value of the variable "$value$" is now: ""
[1] [Mrz 29 17:15:16:131] ___________________
[1] [Mrz 29 17:15:16:139] script finished: failed
[1] [Mrz 29 17:15:16:150] 1 error
[1] [Mrz 29 17:15:16:158] 0 warnings
[1] [Mrz 29 17:15:16:169]
[1] [Mrz 29 17:15:16:180]
[8] [Mrz 29 17:15:16:189] End of CreateAndProcessScript
Code: Alles auswählen
[actions]
SetLogLevel=9
DefVar $value$
DefFunc test($str1$:string):string
Set $result$=$str1$+"extra"
EndFunc
Set $value$ = test("bla")
Im Einsatz befindlich: opsi-winst 4.12.0.13, und wird zum test direkt lokal ausgeführt.
edit:
Hab es soeben nochmal reproduziert.
WInst geschlossen, das gleiche Skript unverändert nochmal ausgeführt, und es funktioniert:
Code: Alles auswählen
[1] [Mrz 29 17:31:39:642] DEU - System default locale
[6] [Mrz 29 17:31:39:645] Registry key [HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion] opened
[6] [Mrz 29 17:31:39:648] Key closed
[1] [Mrz 29 17:31:39:651] MS Windows 10.0 64 Bit, Release: 1607, Edition: Windows Enterprise 2015 LTSB
[1] [Mrz 29 17:31:39:654]
[6] [Mrz 29 17:31:39:657] Registry key [HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion] opened
[6] [Mrz 29 17:31:39:660] Key closed
[6] [Mrz 29 17:31:39:709] LogLevel was 6
[6] [Mrz 29 17:31:39:712] LogLevel set to 9
[9] [Mrz 29 17:31:39:713] Parsingprogress: r: DefVar $value$ exp: SetLogLevel
[9] [Mrz 29 17:31:39:716] Parsingprogress: r: $value$ exp: DefVar
[9] [Mrz 29 17:31:39:721] Parsingprogress: r: DefFunc test($str1$:string):string exp: $value$
[9] [Mrz 29 17:31:39:724] Parsingprogress: r: test($str1$:string):string exp: DefFunc
[8] [Mrz 29 17:31:39:728] Found new defined function name: test
[8] [Mrz 29 17:31:39:731] Found defined function parametername: $str1$
[8] [Mrz 29 17:31:39:737] Parameter has call type: val
[8] [Mrz 29 17:31:39:740] Parameter has valid data type: string
[8] [Mrz 29 17:31:39:743] Function has valid data type: string
[6] [Mrz 29 17:31:39:747] Added defined function:: test to the known functions
[9] [Mrz 29 17:31:39:752] Parsingprogress: r: Set $value$ = test("bla") exp: EndFunc
[9] [Mrz 29 17:31:39:756] Parsingprogress: r: $value$ = test("bla") exp: Set
[6] [Mrz 29 17:31:39:766] Set $value$ = test("bla")
[8] [Mrz 29 17:31:39:777] We are coming from function with index: -1 (-1 = base)
[8] [Mrz 29 17:31:39:788] We enter the defined function: test with 1 lines. inDefFuncLevel: 1
[8] [Mrz 29 17:31:39:797] Paramnr: 0 is : "bla"
[8] [Mrz 29 17:31:39:808] Paramnr: 0 is the string: bla
[9] [Mrz 29 17:31:39:817] Parsingprogress: r: Set $result$=$str1$+"extra" exp:
[9] [Mrz 29 17:31:39:828] Parsingprogress: r: $result$=$str1$+"extra" exp: Set
[6] [Mrz 29 17:31:39:839] Set $result$=$str1$+"extra"
[6] [Mrz 29 17:31:39:857] The value of the variable "$result$" is now: "blaextra"
[8] [Mrz 29 17:31:39:862] We leave the defined function: test ; inDefFuncLevel: 0
[6] [Mrz 29 17:31:39:872] The value of the variable "$value$" is now: "blaextra"
[1] [Mrz 29 17:31:39:903] ___________________
[1] [Mrz 29 17:31:39:911] script finished: success
[1] [Mrz 29 17:31:39:921] 0 errors
[1] [Mrz 29 17:31:39:930] 0 warnings
[1] [Mrz 29 17:31:39:940]
[1] [Mrz 29 17:31:39:950]
[8] [Mrz 29 17:31:39:961] End of CreateAndProcessScript
Die einzige Auffälligkeit im Log ist die Zeile beginnend mit "We enter the defined function: test with 1 lines."
Wenn der Fehler auftritt, kommt danach "inDefFuncLevel: 7" - wenn es funktioniert "inDefFuncLevel: 1".
Sehr frustrierend