Issue Id #11655
Running SCSM 2012 SP1 UR4 with SMLets Beta 4 installed. Two SCSM PowerShell workflows (created with the Authoring Tool) that trigger upon Service Request creation.
Workflow 1 - PowerShell script modifies the activities contained in the SR.
Workflow 2 - PowerShell script modifies the SR itself.
Intermittently, both workflows will fail. This appears to happen when both workflows execute concurrently.
Outputting the error from both we see:
$error[0] | Format-List -Force | Out-String
Running SCSM 2012 SP1 UR4 with SMLets Beta 4 installed. Two SCSM PowerShell workflows (created with the Authoring Tool) that trigger upon Service Request creation.
Workflow 1 - PowerShell script modifies the activities contained in the SR.
Workflow 2 - PowerShell script modifies the SR itself.
Intermittently, both workflows will fail. This appears to happen when both workflows execute concurrently.
Outputting the error from both we see:
$error[0] | Format-List -Force | Out-String
Exception : System.ArgumentException: Item has already been added. Key in dictionary: 'localhost' Key being added: 'localhost' at System.Collections.Hashtable.Insert(Object key, Object nvalue, Boolean add) at SMLets.ConnectionHelper.GetMG(String computerName, PSCredential credential) in c:\Users\Administrator\Documents\WindowsPowerShell\CodePlex\smlets\Main\Source\SMLets\SMLets\Helper.cs:line 301 at SMLets.SMCmdletBase.BeginProcessing() in c:\Users\Administrator\Documents\WindowsPowerShell\CodePlex\smlets\Main\Source\SMLets\SMLets\Helper.cs:line 69
TargetObject : localhost
CategoryInfo : InvalidOperation: (localhost:String) [Get-SCSMClass], ArgumentException
FullyQualifiedErrorId : GenericMessage,SMLets.GetSMClassCommand
ErrorDetails :
InvocationInfo : System.Management.Automation.InvocationInfo
PipelineIterationInfo : {0, 0}
PSMessageDetails :
$error[0].exception | format-list -force | Out-StringMessage : Item has already been added. Key in dictionary: 'localhost' Key being added: 'localhost'
ParamName :
Data : {}
InnerException :
TargetSite : Void Insert(System.Object, System.Object, Boolean)
StackTrace : at System.Collections.Hashtable.Insert(Object key, Object nvalue, Boolean add) at SMLets.ConnectionHelper.GetMG(String computerName, PSCredential credential) in c:\Users\Administrator\Documents\WindowsPowerShell\CodePlex\smlets\Main\Source\SMLets\SMLets\Helper.cs:line 301 at SMLets.SMCmdletBase.BeginProcessing() in c:\Users\Administrator\Documents\WindowsPowerShell\CodePlex\smlets\Main\Source\SMLets\SMLets\Helper.cs:line 69
HelpLink :
Source : mscorlib
$error[0].exception.stacktrace | Out-String at System.Collections.Hashtable.Insert(Object key, Object nvalue, Boolean add)
at SMLets.ConnectionHelper.GetMG(String computerName, PSCredential credential) in c:\Users\Administrator\Documents\WindowsPowerShell\CodePlex\smlets\Main\Source\SMLets\SMLets\Helper.cs:line 301
at SMLets.SMCmdletBase.BeginProcessing() in c:\Users\Administrator\Documents\WindowsPowerShell\CodePlex\smlets\Main\Source\SMLets\SMLets\Helper.cs:line 69