Skip to content

Commit 4d09307

Browse files
committed
Removed unused code for creating ConstrainedRunspace
1 parent 986d28a commit 4d09307

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
@@ -266,31 +266,7 @@ public static Runspace CreateRunspace(
266266
powerShellContext.ConsoleReader = hostUserInterface;
267267
return CreateRunspace(psHost, hostDetails.InitialSessionState);
268268
}
269-
private static InitialSessionState GetUsefulConstrainedISS()
270-
{
271-
InitialSessionState iss = InitialSessionState.Create("Microsoft.PowerShell.Core");
272-
iss.LanguageMode = PSLanguageMode.ConstrainedLanguage;
273-
iss.ImportPSModule(new string[] { "Microsoft.Powershell.Utility", "Microsoft.Powershell.Core", "Microsoft.PowerShell.Security" });
274-
275-
iss.Commands.Add(new SessionStateCmdletEntry("Get-Command", typeof(GetCommandCommand), null));
276-
iss.Commands.Add(new SessionStateCmdletEntry("Get-ChildItem", typeof(PSCommand), null)); //
277-
iss.Commands.Add(new SessionStateCmdletEntry("Export-ModuleMember", typeof(ExportModuleMemberCommand), null));
278-
iss.Commands.Add(new SessionStateCmdletEntry("Where-Object", typeof(WhereObjectCommand), null));
279-
iss.Commands.Add(new SessionStateCmdletEntry("Select-Object", typeof(PSCommand), null));
280-
iss.Commands.Add(new SessionStateCmdletEntry("Set-Variable", typeof(PSCommand), null));
281-
iss.Commands.Add(new SessionStateCmdletEntry("ForEach-Object", typeof(ForEachObjectCommand), null));
282-
iss.Commands.Add(new SessionStateCmdletEntry("Format-List", typeof(PSCommand), null));
283-
iss.Commands.Add(new SessionStateCmdletEntry("Format-Table", typeof(PSCommand), null));
284-
iss.Commands.Add(new SessionStateCmdletEntry("Set-ExecutionPolicy", typeof(PSCommand), null));
285-
iss.Commands.Add(new SessionStateCmdletEntry("Format-Hex", typeof(PSCommand), null));
286-
//iss.Commands.Add(new SessionStateCmdletEntry("Out-Default", typeof(OutDefaultCommand), null));
287-
iss.Commands.Add(new SessionStateCmdletEntry("Microsoft.PowerShell.Core\\Out-Default", typeof(OutDefaultCommand), null) { Visibility = SessionStateEntryVisibility.Public });
288-
iss.Commands.Add(new SessionStateCmdletEntry("Out-Host", typeof(OutHostCommand), null));
289-
iss.Commands.Add(new SessionStateCmdletEntry("Import-Module", typeof(ImportModuleCommand), null));
290-
iss.Commands.Add(new SessionStateCmdletEntry("Start-EditorServices", typeof(PSCommand), null));
291-
292-
return iss;
293-
}
269+
294270
/// <summary>
295271
///
296272
/// </summary>

0 commit comments

Comments
 (0)