Skip to content

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

Merged
merged 3 commits into from
Nov 25, 2018

Conversation

rkeithhill
Copy link
Contributor

@rkeithhill rkeithhill commented Nov 23, 2018

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.

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.
Copy link
Member

@TylerLeonhardt TylerLeonhardt left a 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!

Copy link
Contributor

@rjmholt rjmholt left a 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 {
Copy link
Contributor

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,
Copy link
Contributor

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?

Copy link
Contributor Author

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.

Copy link
Contributor

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 :)

Copy link
Collaborator

@SeeminglyScience SeeminglyScience left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@rkeithhill rkeithhill merged commit f93653b into master Nov 25, 2018
@rkeithhill rkeithhill deleted the rkeithhill/start-pses-cleanup branch November 25, 2018 21:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants