Skip to content
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

[MNTR] Powershell splits CLI arguments on "." before passing them into applications #4924

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion src/core/Akka.Remote.TestKit/CommandLine.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
//-----------------------------------------------------------------------

using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using Akka.Configuration;

Expand All @@ -32,7 +33,23 @@ public class CommandLine
static CommandLine()
{
Values = new StringDictionary();
foreach (var arg in Environment.GetCommandLineArgs())

// Detect and fix PowerShell command line input.
// PowerShell splits command line arguments on '.'
var args = Environment.GetCommandLineArgs();
var fixedArgs = new List<string>();
for (var i = 1; i < args.Length - 1; ++i)
{
if (args[i].Equals("-Dmultinode") && args[i + 1].StartsWith("."))
{
fixedArgs.Add(args[i] + args[i+1]);
++i;
}
}
if(fixedArgs.Count == 0)
fixedArgs.AddRange(args);

foreach (var arg in fixedArgs)
{
if (!arg.StartsWith("-D"))
{
Expand Down