From 95e12f43abe52a37419e57e7f6ea783798a901a7 Mon Sep 17 00:00:00 2001 From: Dongbo Wang Date: Thu, 1 Feb 2024 10:25:49 -0800 Subject: [PATCH 01/13] Update code examples in XML docs in PowerShell.cs --- .../engine/hostifaces/PowerShell.cs | 26 ++++++++++++------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/src/System.Management.Automation/engine/hostifaces/PowerShell.cs b/src/System.Management.Automation/engine/hostifaces/PowerShell.cs index 73bdbdb7c49..e1e6fa362e4 100644 --- a/src/System.Management.Automation/engine/hostifaces/PowerShell.cs +++ b/src/System.Management.Automation/engine/hostifaces/PowerShell.cs @@ -948,7 +948,9 @@ private static PowerShell Create(bool isNested, PSCommand psCommand, Collection< /// Add a cmdlet to construct a command pipeline. /// For example, to construct a command string "get-process | sort-object", /// - /// PowerShell shell = PowerShell.Create("get-process").AddCommand("sort-object"); + /// PowerShell shell = PowerShell.Create() + /// .AddCommand("get-process") + /// .AddCommand("sort-object"); /// /// /// @@ -986,7 +988,9 @@ public PowerShell AddCommand(string cmdlet) /// Add a cmdlet to construct a command pipeline. /// For example, to construct a command string "get-process | sort-object", /// - /// PowerShell shell = PowerShell.Create("get-process").AddCommand("sort-object"); + /// PowerShell shell = PowerShell.Create() + /// .AddCommand("get-process", true) + /// .AddCommand("sort-object", true); /// /// /// @@ -1027,8 +1031,8 @@ public PowerShell AddCommand(string cmdlet, bool useLocalScope) /// Add a piece of script to construct a command pipeline. /// For example, to construct a command string "get-process | foreach { $_.Name }" /// - /// PowerShell shell = PowerShell.Create("get-process"). - /// AddCommand("foreach { $_.Name }", true); + /// PowerShell shell = PowerShell.Create() + /// .AddScript("get-process | foreach { $_.Name }"); /// /// /// @@ -1066,8 +1070,8 @@ public PowerShell AddScript(string script) /// Add a piece of script to construct a command pipeline. /// For example, to construct a command string "get-process | foreach { $_.Name }" /// - /// PowerShell shell = PowerShell.Create("get-process"). - /// AddCommand("foreach { $_.Name }", true); + /// PowerShell shell = PowerShell.Create() + /// .AddScript("get-process | foreach { $_.Name }", true); /// /// /// @@ -1175,8 +1179,9 @@ public PowerShell AddCommand(CommandInfo commandInfo) /// Add a parameter to the last added command. /// For example, to construct a command string "get-process | select-object -property name" /// - /// PowerShell shell = PowerShell.Create("get-process"). - /// AddCommand("select-object").AddParameter("property","name"); + /// PowerShell shell = PowerShell.Create() + /// .AddCommand("get-process") + /// .AddCommand("select-object").AddParameter("property", "name"); /// /// /// @@ -1380,8 +1385,9 @@ public PowerShell AddParameters(IDictionary parameters) /// Adds an argument to the last added command. /// For example, to construct a command string "get-process | select-object name" /// - /// PowerShell shell = PowerShell.Create("get-process"). - /// AddCommand("select-object").AddParameter("name"); + /// PowerShell shell = PowerShell.Create() + /// .AddCommand("get-process") + /// .AddCommand("select-object").AddArgument("name"); /// /// This will add the value "name" to the positional parameter list of "select-object" /// cmdlet. When the command is invoked, this value will get bound to positional parameter 0 From 7bc381c2594d6f516c335ffc41c3e3c01f560e01 Mon Sep 17 00:00:00 2001 From: Dongbo Wang Date: Thu, 1 Feb 2024 11:01:44 -0800 Subject: [PATCH 02/13] Update src/System.Management.Automation/engine/hostifaces/PowerShell.cs Co-authored-by: Sean Wheeler --- .../engine/hostifaces/PowerShell.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/System.Management.Automation/engine/hostifaces/PowerShell.cs b/src/System.Management.Automation/engine/hostifaces/PowerShell.cs index e1e6fa362e4..b3d68186dcd 100644 --- a/src/System.Management.Automation/engine/hostifaces/PowerShell.cs +++ b/src/System.Management.Automation/engine/hostifaces/PowerShell.cs @@ -946,7 +946,7 @@ private static PowerShell Create(bool isNested, PSCommand psCommand, Collection< /// /// Add a cmdlet to construct a command pipeline. - /// For example, to construct a command string "get-process | sort-object", + /// For example, to construct a command string "Get-Process | Sort-Object", /// /// PowerShell shell = PowerShell.Create() /// .AddCommand("get-process") From 9d4a5122a4f6ce0dc3319ab3b90205c3d7a97aea Mon Sep 17 00:00:00 2001 From: Dongbo Wang Date: Thu, 1 Feb 2024 11:01:53 -0800 Subject: [PATCH 03/13] Update src/System.Management.Automation/engine/hostifaces/PowerShell.cs Co-authored-by: Sean Wheeler --- .../engine/hostifaces/PowerShell.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/System.Management.Automation/engine/hostifaces/PowerShell.cs b/src/System.Management.Automation/engine/hostifaces/PowerShell.cs index b3d68186dcd..f7c133df7ca 100644 --- a/src/System.Management.Automation/engine/hostifaces/PowerShell.cs +++ b/src/System.Management.Automation/engine/hostifaces/PowerShell.cs @@ -949,8 +949,8 @@ private static PowerShell Create(bool isNested, PSCommand psCommand, Collection< /// For example, to construct a command string "Get-Process | Sort-Object", /// /// PowerShell shell = PowerShell.Create() - /// .AddCommand("get-process") - /// .AddCommand("sort-object"); + /// .AddCommand("Get-Process") + /// .AddCommand("Sort-Object"); /// /// /// From 68a1ba14bed8dadd7177ee4a881993d4911edaec Mon Sep 17 00:00:00 2001 From: Dongbo Wang Date: Thu, 1 Feb 2024 11:02:00 -0800 Subject: [PATCH 04/13] Update src/System.Management.Automation/engine/hostifaces/PowerShell.cs Co-authored-by: Sean Wheeler --- .../engine/hostifaces/PowerShell.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/System.Management.Automation/engine/hostifaces/PowerShell.cs b/src/System.Management.Automation/engine/hostifaces/PowerShell.cs index f7c133df7ca..19d09e424f1 100644 --- a/src/System.Management.Automation/engine/hostifaces/PowerShell.cs +++ b/src/System.Management.Automation/engine/hostifaces/PowerShell.cs @@ -986,7 +986,7 @@ public PowerShell AddCommand(string cmdlet) /// /// Add a cmdlet to construct a command pipeline. - /// For example, to construct a command string "get-process | sort-object", + /// For example, to construct a command string "Get-Process | Sort-Object", /// /// PowerShell shell = PowerShell.Create() /// .AddCommand("get-process", true) From ec9fa899b0d5340d223e3a18fe95471ce15eb785 Mon Sep 17 00:00:00 2001 From: Dongbo Wang Date: Thu, 1 Feb 2024 11:02:07 -0800 Subject: [PATCH 05/13] Update src/System.Management.Automation/engine/hostifaces/PowerShell.cs Co-authored-by: Sean Wheeler --- .../engine/hostifaces/PowerShell.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/System.Management.Automation/engine/hostifaces/PowerShell.cs b/src/System.Management.Automation/engine/hostifaces/PowerShell.cs index 19d09e424f1..5e3b338451c 100644 --- a/src/System.Management.Automation/engine/hostifaces/PowerShell.cs +++ b/src/System.Management.Automation/engine/hostifaces/PowerShell.cs @@ -989,8 +989,8 @@ public PowerShell AddCommand(string cmdlet) /// For example, to construct a command string "Get-Process | Sort-Object", /// /// PowerShell shell = PowerShell.Create() - /// .AddCommand("get-process", true) - /// .AddCommand("sort-object", true); + /// .AddCommand("Get-Process", true) + /// .AddCommand("Sort-Object", true); /// /// /// From e8120a6eebe99be038861ab12288505bd80d9681 Mon Sep 17 00:00:00 2001 From: Dongbo Wang Date: Thu, 1 Feb 2024 11:02:15 -0800 Subject: [PATCH 06/13] Update src/System.Management.Automation/engine/hostifaces/PowerShell.cs Co-authored-by: Sean Wheeler --- .../engine/hostifaces/PowerShell.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/System.Management.Automation/engine/hostifaces/PowerShell.cs b/src/System.Management.Automation/engine/hostifaces/PowerShell.cs index 5e3b338451c..788c57e95a8 100644 --- a/src/System.Management.Automation/engine/hostifaces/PowerShell.cs +++ b/src/System.Management.Automation/engine/hostifaces/PowerShell.cs @@ -1029,7 +1029,7 @@ public PowerShell AddCommand(string cmdlet, bool useLocalScope) /// /// Add a piece of script to construct a command pipeline. - /// For example, to construct a command string "get-process | foreach { $_.Name }" + /// For example, to construct a command string "Get-Process | ForEach-Object { $_.Name }" /// /// PowerShell shell = PowerShell.Create() /// .AddScript("get-process | foreach { $_.Name }"); From cea5e966e4067e036641ab8a05994069e5c8cfbd Mon Sep 17 00:00:00 2001 From: Dongbo Wang Date: Thu, 1 Feb 2024 11:02:34 -0800 Subject: [PATCH 07/13] Update src/System.Management.Automation/engine/hostifaces/PowerShell.cs Co-authored-by: Sean Wheeler --- .../engine/hostifaces/PowerShell.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/System.Management.Automation/engine/hostifaces/PowerShell.cs b/src/System.Management.Automation/engine/hostifaces/PowerShell.cs index 788c57e95a8..826b425faee 100644 --- a/src/System.Management.Automation/engine/hostifaces/PowerShell.cs +++ b/src/System.Management.Automation/engine/hostifaces/PowerShell.cs @@ -1032,7 +1032,7 @@ public PowerShell AddCommand(string cmdlet, bool useLocalScope) /// For example, to construct a command string "Get-Process | ForEach-Object { $_.Name }" /// /// PowerShell shell = PowerShell.Create() - /// .AddScript("get-process | foreach { $_.Name }"); + /// .AddScript("Get-Process | ForEach-Object { $_.Name }"); /// /// /// From 3b01a974275536b16fee6daf44dc733eb0d1a94b Mon Sep 17 00:00:00 2001 From: Dongbo Wang Date: Thu, 1 Feb 2024 11:02:41 -0800 Subject: [PATCH 08/13] Update src/System.Management.Automation/engine/hostifaces/PowerShell.cs Co-authored-by: Sean Wheeler --- .../engine/hostifaces/PowerShell.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/System.Management.Automation/engine/hostifaces/PowerShell.cs b/src/System.Management.Automation/engine/hostifaces/PowerShell.cs index 826b425faee..9de86555862 100644 --- a/src/System.Management.Automation/engine/hostifaces/PowerShell.cs +++ b/src/System.Management.Automation/engine/hostifaces/PowerShell.cs @@ -1068,7 +1068,7 @@ public PowerShell AddScript(string script) /// /// Add a piece of script to construct a command pipeline. - /// For example, to construct a command string "get-process | foreach { $_.Name }" + /// For example, to construct a command string "Get-Process | ForEach-Object { $_.Name }" /// /// PowerShell shell = PowerShell.Create() /// .AddScript("get-process | foreach { $_.Name }", true); From 8e089dfef7698390ba70426cbef95adabae94c8e Mon Sep 17 00:00:00 2001 From: Dongbo Wang Date: Thu, 1 Feb 2024 11:03:19 -0800 Subject: [PATCH 09/13] Update src/System.Management.Automation/engine/hostifaces/PowerShell.cs Co-authored-by: Sean Wheeler --- .../engine/hostifaces/PowerShell.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/System.Management.Automation/engine/hostifaces/PowerShell.cs b/src/System.Management.Automation/engine/hostifaces/PowerShell.cs index 9de86555862..099b1eb4a66 100644 --- a/src/System.Management.Automation/engine/hostifaces/PowerShell.cs +++ b/src/System.Management.Automation/engine/hostifaces/PowerShell.cs @@ -1071,7 +1071,7 @@ public PowerShell AddScript(string script) /// For example, to construct a command string "Get-Process | ForEach-Object { $_.Name }" /// /// PowerShell shell = PowerShell.Create() - /// .AddScript("get-process | foreach { $_.Name }", true); + /// .AddScript("Get-Process | ForEach-Object { $_.Name }", true); /// /// /// From 69b826e544a128d45b7b08e081f6f46bb3b17457 Mon Sep 17 00:00:00 2001 From: Dongbo Wang Date: Thu, 1 Feb 2024 11:03:34 -0800 Subject: [PATCH 10/13] Update src/System.Management.Automation/engine/hostifaces/PowerShell.cs Co-authored-by: Sean Wheeler --- .../engine/hostifaces/PowerShell.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/System.Management.Automation/engine/hostifaces/PowerShell.cs b/src/System.Management.Automation/engine/hostifaces/PowerShell.cs index 099b1eb4a66..93b73b97fc7 100644 --- a/src/System.Management.Automation/engine/hostifaces/PowerShell.cs +++ b/src/System.Management.Automation/engine/hostifaces/PowerShell.cs @@ -1177,7 +1177,7 @@ public PowerShell AddCommand(CommandInfo commandInfo) /// /// Add a parameter to the last added command. - /// For example, to construct a command string "get-process | select-object -property name" + /// For example, to construct a command string "Get-Process | Select-Object -Property Name" /// /// PowerShell shell = PowerShell.Create() /// .AddCommand("get-process") From 17d6eacc57eeda453cad846a77711b258b15d1cb Mon Sep 17 00:00:00 2001 From: Dongbo Wang Date: Thu, 1 Feb 2024 11:03:41 -0800 Subject: [PATCH 11/13] Update src/System.Management.Automation/engine/hostifaces/PowerShell.cs Co-authored-by: Sean Wheeler --- .../engine/hostifaces/PowerShell.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/System.Management.Automation/engine/hostifaces/PowerShell.cs b/src/System.Management.Automation/engine/hostifaces/PowerShell.cs index 93b73b97fc7..9a2ba973fe6 100644 --- a/src/System.Management.Automation/engine/hostifaces/PowerShell.cs +++ b/src/System.Management.Automation/engine/hostifaces/PowerShell.cs @@ -1180,8 +1180,8 @@ public PowerShell AddCommand(CommandInfo commandInfo) /// For example, to construct a command string "Get-Process | Select-Object -Property Name" /// /// PowerShell shell = PowerShell.Create() - /// .AddCommand("get-process") - /// .AddCommand("select-object").AddParameter("property", "name"); + /// .AddCommand("Get-Process") + /// .AddCommand("Select-Object").AddParameter("Property", "Name"); /// /// /// From c8723146c2bd725d565422cccccb49ab31917c22 Mon Sep 17 00:00:00 2001 From: Dongbo Wang Date: Thu, 1 Feb 2024 11:03:52 -0800 Subject: [PATCH 12/13] Update src/System.Management.Automation/engine/hostifaces/PowerShell.cs Co-authored-by: Sean Wheeler --- .../engine/hostifaces/PowerShell.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/System.Management.Automation/engine/hostifaces/PowerShell.cs b/src/System.Management.Automation/engine/hostifaces/PowerShell.cs index 9a2ba973fe6..f008e7bbe66 100644 --- a/src/System.Management.Automation/engine/hostifaces/PowerShell.cs +++ b/src/System.Management.Automation/engine/hostifaces/PowerShell.cs @@ -1383,7 +1383,7 @@ public PowerShell AddParameters(IDictionary parameters) /// /// Adds an argument to the last added command. - /// For example, to construct a command string "get-process | select-object name" + /// For example, to construct a command string "Get-Process | Select-Object Name" /// /// PowerShell shell = PowerShell.Create() /// .AddCommand("get-process") From 2c8611ee0d896d11a01829ff826c787f59598f21 Mon Sep 17 00:00:00 2001 From: Dongbo Wang Date: Thu, 1 Feb 2024 11:03:59 -0800 Subject: [PATCH 13/13] Update src/System.Management.Automation/engine/hostifaces/PowerShell.cs Co-authored-by: Sean Wheeler --- .../engine/hostifaces/PowerShell.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/System.Management.Automation/engine/hostifaces/PowerShell.cs b/src/System.Management.Automation/engine/hostifaces/PowerShell.cs index f008e7bbe66..503d8e075b6 100644 --- a/src/System.Management.Automation/engine/hostifaces/PowerShell.cs +++ b/src/System.Management.Automation/engine/hostifaces/PowerShell.cs @@ -1386,8 +1386,8 @@ public PowerShell AddParameters(IDictionary parameters) /// For example, to construct a command string "Get-Process | Select-Object Name" /// /// PowerShell shell = PowerShell.Create() - /// .AddCommand("get-process") - /// .AddCommand("select-object").AddArgument("name"); + /// .AddCommand("Get-Process") + /// .AddCommand("Select-Object").AddArgument("Name"); /// /// This will add the value "name" to the positional parameter list of "select-object" /// cmdlet. When the command is invoked, this value will get bound to positional parameter 0