Skip to content

Commit 4badbbc

Browse files
committed
Ignore not finding DSC module
When the user has set `ErrorActionPreference` this could cause a crash, so we have to override it. Resolves #2037.
1 parent 85fd5be commit 4badbbc

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/PowerShellEditorServices/Services/PowerShell/Debugging/DscBreakpointCapability.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,8 @@ public static async Task<DscBreakpointCapability> GetDscCapabilityAsync(
9494
PSCommand psCommand = new PSCommand()
9595
.AddCommand("Import-Module")
9696
.AddArgument(@"C:\Program Files\DesiredStateConfiguration\1.0.0.0\Modules\PSDesiredStateConfiguration\PSDesiredStateConfiguration.psd1")
97-
.AddParameter("PassThru");
97+
.AddParameter("PassThru")
98+
.AddParameter("ErrorAction", ActionPreference.Ignore);
9899

99100
IReadOnlyList<PSModuleInfo> dscModule =
100101
await psesHost.ExecutePSCommandAsync<PSModuleInfo>(

0 commit comments

Comments
 (0)