Add simple test for non-empty workflow, make it work

This commit is contained in:
Sergei Vorobev committed 2016-06-28 12:59:25 -07:00
1 parent 9eda67b00c
commit c4f268f7cd
2 files changed
+7 -1

No files matched your search

@@ -3956,8 +3956,13 @@ namespace Microsoft.PowerShell.Activities
{
try
{
var psvar = runspace.SessionStateProxy.PSVariable.Get(name);
if (psvar == null || (psvar.Options & ScopedItemOptions.ReadOnly) == 0)
{
// don't try to overwrite read-only variables values
runspace.SessionStateProxy.PSVariable.Set(name, value);
}
}
catch (PSNotSupportedException)
{
actionTracer.WriteMessage("SetVariablesInRunspaceUsingProxy: Copying the workflow variables to a RemoteSessionStateProxy is not supported.");
+2 -1
View File
@@ -30,7 +30,8 @@ Describe 'build.psm1 and powershell.exe' {
}
It 'loads Microsoft.PowerShell.Workflow.ServiceCore.dll' {
workflow wfTest {}; wfTest ## Trigger the loading of ServiceCore.dll
workflow wfTest { Split-Path $pwd }
wfTest | Should Not Be $null ## Also trigger the loading of ServiceCore.dll
[Microsoft.PowerShell.Workflow.PSWorkflowJob].Assembly.Location | Should Be (
Join-Path $env:DEVPATH Microsoft.PowerShell.Workflow.ServiceCore.dll)
}