File tree 1 file changed +2
-2
lines changed
src/PowerShellEditorServices/Services/Analysis 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -326,7 +326,7 @@ private Task<PowerShellResult> InvokePowerShellAsync(PSCommand command)
326
326
327
327
private PowerShellResult InvokePowerShell ( PSCommand command )
328
328
{
329
- using ( var powerShell = System . Management . Automation . PowerShell . Create ( ) )
329
+ using ( var powerShell = System . Management . Automation . PowerShell . Create ( RunspaceMode . NewRunspace ) )
330
330
{
331
331
powerShell . RunspacePool = _analysisRunspacePool ;
332
332
powerShell . Commands = command ;
@@ -441,7 +441,7 @@ private IEnumerable<string> GetPSScriptAnalyzerRules()
441
441
/// <returns>A runspace pool with PSScriptAnalyzer loaded for running script analysis tasks.</returns>
442
442
private static RunspacePool CreatePssaRunspacePool ( out PSModuleInfo pssaModuleInfo )
443
443
{
444
- using ( var ps = System . Management . Automation . PowerShell . Create ( ) )
444
+ using ( var ps = System . Management . Automation . PowerShell . Create ( RunspaceMode . NewRunspace ) )
445
445
{
446
446
// Run `Get-Module -ListAvailable -Name "PSScriptAnalyzer"`
447
447
ps . AddCommand ( "Get-Module" )
You can’t perform that action at this time.
0 commit comments