Skip to content

Commit 2685a37

Browse files
committed
Removed commented out code.
1 parent 7fa07e4 commit 2685a37

File tree

1 file changed

+2
-77
lines changed

1 file changed

+2
-77
lines changed

src/PowerShellEditorServices/Services/PowerShellContext/PowerShellContextService.cs

Lines changed: 2 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -50,81 +50,7 @@ public static void AddCommandAndAliasToInitialSessionState<T>(this InitialSessio
5050
iss.Commands.Remove(moduleQualifiedCmdletName, existingLongCmdlet.GetType());
5151
}
5252
iss.Commands.Add(new SessionStateAliasEntry(moduleQualifiedCmdletName, shortName, null));
53-
//throw new Exception($"Unsupported state, {moduleQualifiedCmdletName} and {shortName} defined as Cmdlet types. One needs to be an alias of the other");
54-
}
55-
// if(existingShortCmdlet is SessionStateCmdletEntry)
56-
// {
57-
// if(existingLongCmdlet is null)
58-
// {
59-
// iss.Commands.Add(new SessionStateAliasEntry(shortName, moduleQualifiedCmdletName, null));
60-
// }
61-
// else
62-
// {
63-
64-
// }
65-
// }
66-
// }
67-
68-
// if(existingLongCmdlet is not null)
69-
// else if(existingShortCmdlet is SessionStateAliasEntry)
70-
// {
71-
// if(existingLongCmdlet is null)
72-
// {
73-
// iss.Commands.Add(new SessionStateCmdletEntry(moduleQualifiedCmdletName, typeof(T), null));
74-
// }
75-
// else
76-
// {
77-
// if(existingLongCmdlet is not null && existingLongCmdlet is SessionStateAliasEntry)
78-
// {
79-
// throw new Exception($"Unsupported state, {moduleQualifiedCmdletName} and {shortName} defined as alias types. One needs to be an alias of the other");
80-
// }
81-
// }
82-
// }
83-
// else
84-
// {
85-
// throw new Exception($"Unsupported state, {shortName} exists as an unsupported type. {existingShortCmdlet.GetType().Name}. Needs to be SessionStateCmdletEntry or SessionStateAliasEntry.");
86-
// }
87-
// }
88-
// else
89-
// {
90-
// if(existingLongCmdlet is null)
91-
// {
92-
// if(existingShortCmdlet is null)
93-
// {
94-
// //iss.Commands.Add(new SessionStateCmdletEntry(moduleQualifiedCmdletName, typeof(T), null));
95-
// //iss.Commands.Add(new SessionStateAliasEntry(shortName, moduleQualifiedCmdletName, null));
96-
// iss.Commands.Add(new SessionStateCmdletEntry(shortName, typeof(T), null));
97-
// iss.Commands.Add(new SessionStateAliasEntry(moduleQualifiedCmdletName, shortName, null));
98-
// }
99-
// else
100-
// {
101-
// if(existingShortCmdlet is SessionStateAliasEntry)
102-
// {
103-
// iss.Commands.Add(new SessionStateCmdletEntry(moduleQualifiedCmdletName, typeof(T), null));
104-
// }
105-
// else if(existingShortCmdlet is SessionStateCmdletEntry)
106-
// {
107-
// iss.Commands.Add(new SessionStateAliasEntry(moduleQualifiedCmdletName, shortName, null));
108-
// }
109-
// else
110-
// {
111-
// throw new Exception($"Unsupported state, {shortName} exists as an unsupported type. {existingShortCmdlet.GetType().Name}. Needs to be SessionStateCmdletEntry or SessionStateAliasEntry.");
112-
// }
113-
// }
114-
115-
// }
116-
// else
117-
// {
118-
// if((existingLongCmdlet is SessionStateAliasEntry && existingShortCmdlet is SessionStateCmdletEntry) || (existingLongCmdlet is SessionStateCmdletEntry && existingShortCmdlet is SessionStateAliasEntry))
119-
// {
120-
// // All good
121-
// }
122-
// else
123-
// {
124-
// throw new Exception($"Unsupported state, {shortName} defined as type {existingShortCmdlet.GetType().Name} type and {moduleQualifiedCmdletName} defined as {existingLongCmdlet.GetType().Name}. One needs to be an alias of the other.");
125-
// }
126-
// }
127-
// }
53+
}
12854
}
12955
}
13056
/// <summary>
@@ -490,8 +416,7 @@ bool ownsInitialRunspace
490416
hostStartupInfo.InitialSessionState.AddCommandAndAliasToInitialSessionState<GetCommandCommand>(@"Microsoft.PowerShell.Core\Get-Command");
491417
hostStartupInfo.InitialSessionState.AddCommandAndAliasToInitialSessionState<GetHelpCommand>(@"Microsoft.PowerShell.Core\Get-Help");
492418
hostStartupInfo.InitialSessionState.AddCommandAndAliasToInitialSessionState<GetModuleCommand>(@"Microsoft.PowerShell.Core\Get-Module");
493-
hostStartupInfo.InitialSessionState.AddCommandAndAliasToInitialSessionState<OutDefaultCommand>(@"Microsoft.PowerShell.Core\Out-Default");
494-
//hostStartupInfo.InitialSessionState.AddCommandAndAliasToInitialSessionState<Microsoft.PowerShell.Commands.WriteHostCommand>(@"Microsoft.PowerShell.Core\Write-Host");
419+
hostStartupInfo.InitialSessionState.AddCommandAndAliasToInitialSessionState<OutDefaultCommand>(@"Microsoft.PowerShell.Core\Out-Default");
495420

496421
initialRunspace = CreateRunspace(hostStartupInfo.PSHost, hostStartupInfo.InitialSessionState);
497422
}

0 commit comments

Comments
 (0)