Skip to content

Commit 8af273c

Browse files
committed
Removed unused code for creating ConstrainedRunspace
1 parent 0548349 commit 8af273c

File tree

1 file changed

+1
-25
lines changed

1 file changed

+1
-25
lines changed

src/PowerShellEditorServices/Services/PowerShellContext/PowerShellContextService.cs

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -270,31 +270,7 @@ public static Runspace CreateRunspace(
270270
powerShellContext.ConsoleReader = hostUserInterface;
271271
return CreateRunspace(psHost, hostDetails.InitialSessionState);
272272
}
273-
private static InitialSessionState GetUsefulConstrainedISS()
274-
{
275-
InitialSessionState iss = InitialSessionState.Create("Microsoft.PowerShell.Core");
276-
iss.LanguageMode = PSLanguageMode.ConstrainedLanguage;
277-
iss.ImportPSModule(new string[] { "Microsoft.Powershell.Utility", "Microsoft.Powershell.Core", "Microsoft.PowerShell.Security" });
278-
279-
iss.Commands.Add(new SessionStateCmdletEntry("Get-Command", typeof(GetCommandCommand), null));
280-
iss.Commands.Add(new SessionStateCmdletEntry("Get-ChildItem", typeof(PSCommand), null)); //
281-
iss.Commands.Add(new SessionStateCmdletEntry("Export-ModuleMember", typeof(ExportModuleMemberCommand), null));
282-
iss.Commands.Add(new SessionStateCmdletEntry("Where-Object", typeof(WhereObjectCommand), null));
283-
iss.Commands.Add(new SessionStateCmdletEntry("Select-Object", typeof(PSCommand), null));
284-
iss.Commands.Add(new SessionStateCmdletEntry("Set-Variable", typeof(PSCommand), null));
285-
iss.Commands.Add(new SessionStateCmdletEntry("ForEach-Object", typeof(ForEachObjectCommand), null));
286-
iss.Commands.Add(new SessionStateCmdletEntry("Format-List", typeof(PSCommand), null));
287-
iss.Commands.Add(new SessionStateCmdletEntry("Format-Table", typeof(PSCommand), null));
288-
iss.Commands.Add(new SessionStateCmdletEntry("Set-ExecutionPolicy", typeof(PSCommand), null));
289-
iss.Commands.Add(new SessionStateCmdletEntry("Format-Hex", typeof(PSCommand), null));
290-
//iss.Commands.Add(new SessionStateCmdletEntry("Out-Default", typeof(OutDefaultCommand), null));
291-
iss.Commands.Add(new SessionStateCmdletEntry("Microsoft.PowerShell.Core\\Out-Default", typeof(OutDefaultCommand), null) { Visibility = SessionStateEntryVisibility.Public });
292-
iss.Commands.Add(new SessionStateCmdletEntry("Out-Host", typeof(OutHostCommand), null));
293-
iss.Commands.Add(new SessionStateCmdletEntry("Import-Module", typeof(ImportModuleCommand), null));
294-
iss.Commands.Add(new SessionStateCmdletEntry("Start-EditorServices", typeof(PSCommand), null));
295-
296-
return iss;
297-
}
273+
298274
/// <summary>
299275
///
300276
/// </summary>

0 commit comments

Comments
 (0)