You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Initialize runspaces with InitialSessionState object
Instead of passing values for `LanguageMode` and `ExecutionPolicy` as
fields that are set on an `InitialSessionState` object that's eventually
created, we now pass a fully initialized `InitialSessionState` object
from the start.
We also rename `SetExecutionPolicy` to `RestoreExecutionPolicy` to
reflect what it actually does: restores the user's policy after we
overrode it with `Bypass` while initializing the integrated console's
runspace. We override it because we need to be able to load `PSReadLine`
etc. without policy issues.
Finally, we fix the EditorConfig setting to enforce spaces after
control-flow keywords (such as `if`) because, while our codebase is
inconsistent, it is our preferred style going forward.
/// The minimum log level of log events to be logged.
@@ -135,7 +135,7 @@ public sealed class HostStartupInfo
135
135
/// <param name="currentUsersProfilePath">The path to the user specific profile.</param>
136
136
/// <param name="featureFlags">Flags of features to enable.</param>
137
137
/// <param name="additionalModules">Names or paths of additional modules to import.</param>
138
-
/// <param name="languageMode">The language mode inherited from the orginal PowerShell process. This will be used when creating runspaces so that we honor the same language mode.</param>
138
+
/// <param name="initialSessionState">The language mode inherited from the orginal PowerShell process. This will be used when creating runspaces so that we honor the same initialSessionState including allowed modules, cmdlets and language mode.</param>
139
139
/// <param name="logPath">The path to log to.</param>
/// <param name="psHost">The PSHost that will be used for this Runspace.</param>
284
-
/// <param name="languageMode">The language mode inherited from the orginal PowerShell process. This will be used when creating runspaces so that we honor the same language mode.</param>
286
+
/// <param name="initialSessionState">This will be used when creating runspaces so that we honor the same InitialSessionState.</param>
0 commit comments