-
Notifications
You must be signed in to change notification settings - Fork 234
Code cleanup of the start script and ESHost.cs file #796
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Address some PSSA warnings, version guard access to $Is<platforms> vars, rename Test-NamedPipeName-OrCreate-IfNull to Get-ValidatedNamedPipeName. Not 100% sold on the new name so open to suggestions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Just a couple comments. Thanks for the clean up, Keith!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Much improved! Thanks @rkeithhill!
@@ -268,33 +271,37 @@ function Set-NamedPipeMode { | |||
LogSection "Console Encoding" | |||
Log $OutputEncoding | |||
|
|||
function Test-NamedPipeName-OrCreate-IfNull { | |||
function Get-ValidatedNamedPipeName { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So much nicer!
@@ -243,7 +246,7 @@ public void StartLogging(string logFilePath, LogLevel logLevel) | |||
foreach (string module in this.additionalModules) | |||
{ | |||
await this.editorSession.PowerShellContext.ExecuteCommand<System.Management.Automation.PSObject>( | |||
new System.Management.Automation.PSCommand().AddCommand("Import-Module").AddArgument(module), | |||
new System.Management.Automation.PSCommand().AddCommand("Microsoft.PowerShell.Core\\Import-Module").AddArgument(module), | |||
false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe a good time to label these arguments too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You mean .AddCommand("Microsoft.PowerShell.Core\\Import-Module").AddParameter("Name", module),
? If so, yeah, makes senses to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I meant the true
and false
in C#. But I'm in favour of all of it :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Address some PSSA warnings, version guard access to
$Is<platform>
vars,rename Test-NamedPipeName-OrCreate-IfNull to Get-ValidatedNamedPipeName.
Not 100% sold on the new name so open to suggestions.