diff --git a/PoshBot/Classes/Command.ps1 b/PoshBot/Classes/Command.ps1 index 9ede5190..d591c8e2 100644 --- a/PoshBot/Classes/Command.ps1 +++ b/PoshBot/Classes/Command.ps1 @@ -69,7 +69,7 @@ class Command : BaseLogger { # } # Execute the command in a PowerShell job and return the running job - [object]Invoke([ParsedCommand]$ParsedCommand, [bool]$InvokeAsJob = $this.AsJob) { + [object]Invoke([ParsedCommand]$ParsedCommand, [bool]$InvokeAsJob = $this.AsJob, [string]$Backend) { $outer = { [cmdletbinding()] @@ -96,6 +96,7 @@ class Command : BaseLogger { ConfigurationDirectory = $options.ConfigurationDirectory ParsedCommand = $options.ParsedCommand | Select-Object -ExcludeProperty $parsedCommandExcludes OriginalMessage = $options.OriginalMessage + BackendType = $options.BackendType } & $cmd @namedParameters @positionalParameters @@ -108,6 +109,7 @@ class Command : BaseLogger { CallingUserInfo = $ParsedCommand.CallingUserInfo OriginalMessage = $ParsedCommand.OriginalMessage.ToHash() ConfigurationDirectory = $script:ConfigurationDirectory + BackendType = $Backend } if ($this.FunctionInfo) { $options.Function = $this.FunctionInfo diff --git a/PoshBot/Classes/CommandExecutor.ps1 b/PoshBot/Classes/CommandExecutor.ps1 index 717b5499..3a3d6796 100644 --- a/PoshBot/Classes/CommandExecutor.ps1 +++ b/PoshBot/Classes/CommandExecutor.ps1 @@ -103,7 +103,7 @@ class CommandExecutor : BaseLogger { # Kick off job and add to job tracker $cmdExecContext.IsJob = $true - $cmdExecContext.Job = $cmdExecContext.Command.Invoke($cmdExecContext.ParsedCommand, $true) + $cmdExecContext.Job = $cmdExecContext.Command.Invoke($cmdExecContext.ParsedCommand, $true,$this._bot.Backend.GetType().Name) $this.LogDebug("Command [$($cmdExecContext.FullyQualifiedCommandName)] executing in job [$($cmdExecContext.Job.Id)]") $cmdExecContext.Complete = $false } else { @@ -111,7 +111,7 @@ class CommandExecutor : BaseLogger { # This should only be 'builtin' commands try { $cmdExecContext.IsJob = $false - $hash = $cmdExecContext.Command.Invoke($cmdExecContext.ParsedCommand, $false) + $hash = $cmdExecContext.Command.Invoke($cmdExecContext.ParsedCommand, $false,$this._bot.Backend.GetType().Name) $cmdExecContext.Complete = $true $cmdExecContext.Ended = (Get-Date).ToUniversalTime() $cmdExecContext.Result.Errors = $hash.Error