mirror of
https://github.com/PowerShell/PowerShell
synced 2026-06-08 12:12:50 +00:00
get-counter issue with -computer parameter (#15166)
* get-counter issue fixed * Update src/Microsoft.PowerShell.Commands.Diagnostics/GetCounterCommand.cs Co-authored-by: Krishna Yalavarthi <kryalava@microsoft.com> Co-authored-by: Travis Plunk <travis.plunk@microsoft.com>
This commit is contained in:
co-authored by
Krishna Yalavarthi
Travis Plunk
parent
a6abf16941
commit
8a3e02dcf7
@@ -587,13 +587,14 @@ namespace Microsoft.PowerShell.Commands
|
||||
{
|
||||
foreach (string machine in ComputerName)
|
||||
{
|
||||
string slashBeforePath = path.Length > 0 && path[0] == '\\' ? string.Empty : "\\";
|
||||
if (machine.StartsWith("\\\\", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
retColl.Add(machine + "\\" + path);
|
||||
retColl.Add(machine + slashBeforePath + path);
|
||||
}
|
||||
else
|
||||
{
|
||||
retColl.Add("\\\\" + machine + "\\" + path);
|
||||
retColl.Add("\\\\" + machine + slashBeforePath + path);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user