Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/PowerShell/PowerShell.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>2022-09-13 20:51:48 +0300
committerGitHub <noreply@github.com>2022-09-13 20:51:48 +0300
commit78b555bdb08bc2955bab929de2ac9d7cc22b4464 (patch)
tree4be55c84e47f5bc3b44e7329b49d631bf7ce443c
parente1d5af6dfd56f41578eadb17bc33173024483eb5 (diff)
[release/v7.3.0-rc.1] Make experimental feature `PSExec` stable (#18077)
-rw-r--r--experimental-feature-linux.json1
-rw-r--r--experimental-feature-windows.json1
-rw-r--r--src/System.Management.Automation/engine/ExperimentalFeature/ExperimentalFeature.cs6
-rw-r--r--src/System.Management.Automation/engine/InitialSessionState.cs10
-rw-r--r--src/System.Management.Automation/engine/Modules/SwitchProcessCommand.cs1
-rw-r--r--test/powershell/Modules/Microsoft.PowerShell.Core/Exec.Tests.ps14
-rw-r--r--test/powershell/engine/Basic/DefaultCommands.Tests.ps12
7 files changed, 7 insertions, 18 deletions
diff --git a/experimental-feature-linux.json b/experimental-feature-linux.json
index 863872016b..326b8f608e 100644
--- a/experimental-feature-linux.json
+++ b/experimental-feature-linux.json
@@ -1,7 +1,6 @@
[
"PSAMSIMethodInvocationLogging",
"PSCommandNotFoundSuggestion",
- "PSExec",
"PSLoadAssemblyFromNativeCode",
"PSNativeCommandErrorActionPreference",
"PSRemotingSSHTransportErrorHandling",
diff --git a/experimental-feature-windows.json b/experimental-feature-windows.json
index 863872016b..326b8f608e 100644
--- a/experimental-feature-windows.json
+++ b/experimental-feature-windows.json
@@ -1,7 +1,6 @@
[
"PSAMSIMethodInvocationLogging",
"PSCommandNotFoundSuggestion",
- "PSExec",
"PSLoadAssemblyFromNativeCode",
"PSNativeCommandErrorActionPreference",
"PSRemotingSSHTransportErrorHandling",
diff --git a/src/System.Management.Automation/engine/ExperimentalFeature/ExperimentalFeature.cs b/src/System.Management.Automation/engine/ExperimentalFeature/ExperimentalFeature.cs
index 2906f48ba8..8d8c2dd312 100644
--- a/src/System.Management.Automation/engine/ExperimentalFeature/ExperimentalFeature.cs
+++ b/src/System.Management.Automation/engine/ExperimentalFeature/ExperimentalFeature.cs
@@ -24,7 +24,6 @@ namespace System.Management.Automation
internal const string PSNativeCommandErrorActionPreferenceFeatureName = "PSNativeCommandErrorActionPreference";
internal const string PSRemotingSSHTransportErrorHandling = "PSRemotingSSHTransportErrorHandling";
internal const string PSAMSIMethodInvocationLogging = "PSAMSIMethodInvocationLogging";
- internal const string PSExecFeatureName = "PSExec";
#endregion
@@ -124,10 +123,7 @@ namespace System.Management.Automation
description: "Removes the SSH remoting transport stdErr stream message handling as terminating errors, and instead just writes error messages to console."),
new ExperimentalFeature(
name: PSAMSIMethodInvocationLogging,
- description: "Provides AMSI notification of .NET method invocations."),
- new ExperimentalFeature(
- name: PSExecFeatureName,
- description: "Add 'exec' built-in command on Linux and macOS"),
+ description: "Provides AMSI notification of .NET method invocations.")
};
EngineExperimentalFeatures = new ReadOnlyCollection<ExperimentalFeature>(engineFeatures);
diff --git a/src/System.Management.Automation/engine/InitialSessionState.cs b/src/System.Management.Automation/engine/InitialSessionState.cs
index 09feaa0fdb..072323c7a0 100644
--- a/src/System.Management.Automation/engine/InitialSessionState.cs
+++ b/src/System.Management.Automation/engine/InitialSessionState.cs
@@ -4678,10 +4678,7 @@ end {
};
#if UNIX
- if (ExperimentalFeature.IsEnabled(ExperimentalFeature.PSExecFeatureName))
- {
- builtInAliases.Add(new SessionStateAliasEntry("exec", "Switch-Process"));
- }
+ builtInAliases.Add(new SessionStateAliasEntry("exec", "Switch-Process"));
#endif
return builtInAliases.ToArray();
@@ -5323,10 +5320,7 @@ end {
}
#if UNIX
- if (ExperimentalFeature.IsEnabled(ExperimentalFeature.PSExecFeatureName))
- {
- cmdlets.Add("Switch-Process", new SessionStateCmdletEntry("Switch-Process", typeof(SwitchProcessCommand), helpFile));
- }
+ cmdlets.Add("Switch-Process", new SessionStateCmdletEntry("Switch-Process", typeof(SwitchProcessCommand), helpFile));
#endif
foreach (var val in cmdlets.Values)
diff --git a/src/System.Management.Automation/engine/Modules/SwitchProcessCommand.cs b/src/System.Management.Automation/engine/Modules/SwitchProcessCommand.cs
index 298587679b..1bad35bfd3 100644
--- a/src/System.Management.Automation/engine/Modules/SwitchProcessCommand.cs
+++ b/src/System.Management.Automation/engine/Modules/SwitchProcessCommand.cs
@@ -17,7 +17,6 @@ namespace Microsoft.PowerShell.Commands
/// <summary>
/// Implements a cmdlet that allows use of execv API.
/// </summary>
- [Experimental(ExperimentalFeature.PSExecFeatureName, ExperimentAction.Show)]
[Cmdlet(VerbsCommon.Switch, "Process", HelpUri = "https://go.microsoft.com/fwlink/?linkid=2181448")]
public sealed class SwitchProcessCommand : PSCmdlet
{
diff --git a/test/powershell/Modules/Microsoft.PowerShell.Core/Exec.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Core/Exec.Tests.ps1
index bd3c87e0f5..640fb8e0fc 100644
--- a/test/powershell/Modules/Microsoft.PowerShell.Core/Exec.Tests.ps1
+++ b/test/powershell/Modules/Microsoft.PowerShell.Core/Exec.Tests.ps1
@@ -4,7 +4,7 @@
Describe 'Switch-Process tests for Unix' -Tags 'CI' {
BeforeAll {
$originalDefaultParameterValues = $PSDefaultParameterValues.Clone()
- if (-not [ExperimentalFeature]::IsEnabled('PSExec') -or $IsWindows)
+ if ($IsWindows)
{
$PSDefaultParameterValues['It:Skip'] = $true
return
@@ -53,7 +53,7 @@ Describe 'Switch-Process tests for Unix' -Tags 'CI' {
Describe 'Switch-Process for Windows' {
BeforeAll {
$originalDefaultParameterValues = $PSDefaultParameterValues.Clone()
- if (-not $IsWindows)
+ if (!$IsWindows)
{
$PSDefaultParameterValues['It:Skip'] = $true
return
diff --git a/test/powershell/engine/Basic/DefaultCommands.Tests.ps1 b/test/powershell/engine/Basic/DefaultCommands.Tests.ps1
index aaa6cb432b..bdcd5af000 100644
--- a/test/powershell/engine/Basic/DefaultCommands.Tests.ps1
+++ b/test/powershell/engine/Basic/DefaultCommands.Tests.ps1
@@ -58,6 +58,7 @@ Describe "Verify approved aliases list" -Tags "CI" {
"Alias", "epsn", "Export-PSSession", $($FullCLR ), "", "", ""
"Alias", "erase", "Remove-Item", $($FullCLR -or $CoreWindows -or $CoreUnix), "", "", ""
"Alias", "etsn", "Enter-PSSession", $($FullCLR -or $CoreWindows -or $CoreUnix), "", "", ""
+"Alias", "exec", "Switch-Process", $( $CoreUnix), "", "", ""
"Alias", "exsn", "Exit-PSSession", $($FullCLR -or $CoreWindows -or $CoreUnix), "", "", ""
"Alias", "fc", "Format-Custom", $($FullCLR -or $CoreWindows -or $CoreUnix), "ReadOnly", "", ""
"Alias", "fhx", "Format-Hex", $($FullCLR -or $CoreWindows -or $CoreUnix), "", "", ""
@@ -482,6 +483,7 @@ Describe "Verify approved aliases list" -Tags "CI" {
"Cmdlet", "Stop-Transcript", "", $($FullCLR -or $CoreWindows -or $CoreUnix), "", "", "None"
"Cmdlet", "Suspend-Job", "", $($FullCLR ), "", "", ""
"Cmdlet", "Suspend-Service", "", $($FullCLR -or $CoreWindows ), "", "", "Medium"
+"Cmdlet", "Switch-Process", "", $( $CoreUnix), "", "", "None"
"Cmdlet", "Tee-Object", "", $($FullCLR -or $CoreWindows -or $CoreUnix), "", "", "Medium"
"Cmdlet", "Test-Connection", "", $( $CoreWindows -or $CoreUnix), "", "", "None"
"Cmdlet", "Test-ComputerSecureChannel", "", $($FullCLR ), "", "", ""