Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3956,7 +3956,12 @@ private static void SetVariablesInRunspaceUsingProxy(PSActivityEnvironment activ
{
try
{
runspace.SessionStateProxy.PSVariable.Set(name, value);
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)
{
Expand Down
3 changes: 2 additions & 1 deletion test/fullclr/PowerShellGithubDev.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down