@@ -7,11 +7,14 @@ namespace Microsoft.Azure.Functions.PowerShellWorker.Durable
7
7
{
8
8
using System ;
9
9
using System . Management . Automation ;
10
+ using Microsoft . Azure . Functions . PowerShellWorker . Utility ;
10
11
11
12
internal class PowerShellServices : IPowerShellServices
12
13
{
13
14
private const string SetFunctionInvocationContextCommand =
14
15
"Microsoft.Azure.Functions.PowerShellWorker\\ Set-FunctionInvocationContext" ;
16
+ private const string SetFunctionInvocationContextExternalCommand =
17
+ "DurableSDK\\ Set-FunctionInvocationContextExternal" ;
15
18
16
19
private readonly PowerShell _pwsh ;
17
20
private bool _hasSetOrchestrationContext = false ;
@@ -36,7 +39,9 @@ public bool UsesExternalDurableSDK()
36
39
37
40
public void SetDurableClient ( object durableClient )
38
41
{
39
- _pwsh . AddCommand ( SetFunctionInvocationContextCommand )
42
+ _pwsh . AddCommand ( Utils . ImportModuleCmdletInfo )
43
+ . AddParameter ( "Name" , "DurableSDK" ) ;
44
+ _pwsh . AddCommand ( SetFunctionInvocationContextExternalCommand )
40
45
. AddParameter ( "DurableClient" , durableClient )
41
46
. InvokeAndClearCommands ( ) ;
42
47
@@ -46,7 +51,7 @@ public void SetDurableClient(object durableClient)
46
51
47
52
public void SetOrchestrationContext ( OrchestrationContext orchestrationContext )
48
53
{
49
- _pwsh . AddCommand ( SetFunctionInvocationContextCommand )
54
+ _pwsh . AddCommand ( SetFunctionInvocationContextExternalCommand )
50
55
. AddParameter ( "OrchestrationContext" , orchestrationContext )
51
56
. InvokeAndClearCommands ( ) ;
52
57
@@ -62,7 +67,7 @@ public void ClearOrchestrationContext()
62
67
{
63
68
if ( _hasSetOrchestrationContext )
64
69
{
65
- _pwsh . AddCommand ( SetFunctionInvocationContextCommand )
70
+ _pwsh . AddCommand ( SetFunctionInvocationContextExternalCommand )
66
71
. AddParameter ( "Clear" , true )
67
72
. InvokeAndClearCommands ( ) ;
68
73
}
0 commit comments