It looks like this piece of code behaves differently for onPrem and XMC
resulting in different decision for the following if statement
The difference is caused by this command
TabExpansion2 "[linkmana" 9
returning different results
XMC - returns 1
onPrem - returns nothing - because there is an exception once it's invoked
logs:
ManagedPoolThread #7 15:33:11 WARN Exception calling "CompleteInput" with "3" argument(s): "Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information."At line:38 char:16
+ ... return [System.Management.Automation.CommandCompletion]::Complet ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Exception: System.Management.Automation.MethodInvocationException
Message: Exception calling "CompleteInput" with "3" argument(s): "Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information."
Source: System.Management.Automation
at System.Management.Automation.ExceptionHandlingOps.ConvertToMethodInvocationException(Exception exception, Type typeToThrow, String methodName, Int32 numArgs, MemberInfo memberInfo)
at CallSite.Target(Closure , CallSite , Type , String , Int32 , Hashtable )
at System.Management.Automation.Interpreter.DynamicInstruction`5.Run(InterpretedFrame frame)
at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
Nested Exception
Exception: System.Reflection.ReflectionTypeLoadException
Message: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
Source: mscorlib
at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module)
at System.Reflection.Assembly.GetTypes()
at System.Management.Automation.CompletionCompleters.<>c.<InitializeTypeCache>b__111_0(Assembly assembly)
at System.Linq.Enumerable.<SelectManyIterator>d__17`2.MoveNext()
at System.Management.Automation.CompletionCompleters.InitializeTypeCache()
at System.Management.Automation.CompletionCompleters.CompleteType(CompletionContext context, String prefix, String suffix)
at System.Management.Automation.CompletionAnalysis.GetResultHelper(CompletionContext completionContext, Int32& replacementIndex, Int32& replacementLength, Boolean isQuotedString)
at System.Management.Automation.CompletionAnalysis.GetResults(PowerShell powerShell, Int32& replacementIndex, Int32& replacementLength)
at System.Management.Automation.CommandCompletion.CompleteInputImpl(Ast ast, Token[] tokens, IScriptPosition positionOfCursor, Hashtable options)
at CallSite.Target(Closure , CallSite , Type , String , Int32 , Hashtable )
45496 15:33:26 INFO Arbitrary script execution in ISE by user: 'sitecore\Admin'
Expected Behavior
Selected entry from suggestions window pasted into editor
Actual Behavior
Empty string/whitespaces pasted
Steps to Reproduce the Problem
video with steps https://github.com/user-attachments/assets/c0e82c14-3331-4e29-98db-7e49b0a49f77
Dev notes:
It looks like this piece of code behaves differently for onPrem and XMC
resulting in different decision for the following
if
statementThe difference is caused by this command
TabExpansion2 "[linkmana" 9
returning different results1
logs: