8000 [release/v7.3.0-rc.1] Make experimental feature `PSExec` stable (#18077) · PowerShell/PowerShell@78b555b · GitHub
[go: up one dir, main page]

Skip to content

Commit 78b555b

Browse files
[release/v7.3.0-rc.1] Make experimental feature PSExec stable (#18077)
1 parent e1d5af6 commit 78b555b

File tree

7 files changed

+7
-18
lines changed

7 files changed

+7
-18
lines changed

experimental-feature-linux.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
[
22
"PSAMSIMethodInvocationLogging",
33
"PSCommandNotFoundSuggestion",
4-
"PSExec",
54
"PSLoadAssemblyFromNativeCode",
65
"PSNativeCommandErrorActionPreference",
76
"PSRemotingSSHTransportErrorHandling",

experimental-feature-windows.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
[
22
"PSAMSIMethodInvocationLogging",
33
"PSCommandNotFoundSuggestion",
4-
"PSExec",
54
"PSLoadAssemblyFromNativeCode",
65
"PSNativeCommandErrorActionPreference",
76
"PSRemotingSSHTransportErrorHandling",

src/System.Management.Automation/engine/ExperimentalFeature/ExperimentalFeature.cs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ public class ExperimentalFeature
2424
internal const string PSNativeCommandErrorActionPreferenceFeatureName = "PSNativeCommandErrorActionPreference";
2525
internal const string PSRemotingSSHTransportErrorHandling = "PSRemotingSSHTransportErrorHandling";
2626
internal const string PSAMSIMethodInvocationLogging = "PSAMSIMethodInvocationLogging";
27-
internal const string PSExecFeatureName = "PSExec";
2827

2928
#endregion
3029

@@ -124,10 +123,7 @@ static ExperimentalFeature()
124123
description: "Removes the SSH remoting transport stdErr stream message handling as terminating errors, and instead just writes error messages to console."),
125124
new ExperimentalFeature(
126125
name: PSAMSIMethodInvocationLogging,
127-
description: "Provides AMSI notification of .NET method invocations."),
128-
new ExperimentalFeature(
129-
name: PSExecFeatureName,
130-
description: "Add 'exec' built-in command on Linux and macOS"),
126+
description: "Provides AMSI notification of .NET method invocations.")
131127
};
132128

133129
EngineExperimentalFeatures = new ReadOnlyCollection<ExperimentalFeature>(engineFeatures);

src/System.Management.Automation/engine/InitialSessionState.cs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4678,10 +4678,7 @@ internal static SessionStateAliasEntry[] BuiltInAliases
46784678
};
46794679

46804680
#if UNIX
4681-
if (ExperimentalFeature.IsEnabled(ExperimentalFeature.PSExecFeatureName))
4682-
{
4683-
builtInAliases.Add(new SessionStateAliasEntry("exec", "Switch-Process"));
4684-
}
4681+
builtInAliases.Add(new SessionStateAliasEntry("exec", "Switch-Process"));
46854682
#endif
46864683

46874684
return builtInAliases.ToArray();
@@ -5323,10 +5320,7 @@ private static void InitializeCoreCmdletsAndProviders(
53235320
}
53245321

53255322
#if UNIX
5326-
if (ExperimentalFeature.IsEnabled(ExperimentalFeature.PSExecFeatureName))
5327-
{
5328-
cmdlets.Add("Switch-Process", new SessionStateCmdletEntry("Switch-Process", typeof(SwitchProcessCommand), helpFile));
5329-
}
5323+
cmdlets.Add("Switch-Process", new SessionStateCmdletEntry("Switch-Process", typeof(SwitchProcessCommand), helpFile));
53305324
#endif
53315325

53325326
foreach (var val in cmdlets.Values)

src/System.Management.Automation/engine/Modules/SwitchProcessCommand.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ namespace Microsoft.PowerShell.Commands
1717
/// <summary>
1818
/// Implements a cmdlet that allows use of execv API.
1919
/// </summary>
20-
[Experimental(ExperimentalFeature.PSExecFeatureName, ExperimentAction.Show)]
2120
[Cmdlet(VerbsCommon.Switch, "Process", HelpUri = "https://go.microsoft.com/fwlink/?linkid=2181448")]
2221
public sealed class SwitchProcessCommand : PSCmdlet
2322
{

test/powershell/Modules/Microsoft.PowerShell.Core/Exec.Tests.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
Describe 'Switch-Process tests for Unix' -Tags 'CI' {
55
BeforeAll {
66
$originalDefaultParameterValues = $PSDefaultParameterValues.Clone()
7-
if (-not [ExperimentalFeature]::IsEnabled('PSExec') -or $IsWindows)
7+
if ($IsWindows)
88
{
99
$PSDefaultParameterValues['It:Skip'] = $true
1010
return
@@ -53,7 +53,7 @@ Describe 'Switch-Process tests for Unix' -Tags 'CI' {
5353
Describe 'Switch-Process for Windows' {
5454
BeforeAll {
5555
$originalDefaultParameterValues = $PSDefaultParameterValues.Clone()
56-
if (-not $IsWindows)
56+
if (!$IsWindows)
5757
{
5858
$PSDefaultParameterValues['It:Skip'] = $true
5959
return

test/powershell/engine/Basic/DefaultCommands.Tests.ps1

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ Describe "Verify approved aliases list" -Tags "CI" {
5858
"Alias", "epsn", "Export-PSSession", $($FullCLR ), "", "", ""
5959
"Alias", "erase", "Remove-Item", $($FullCLR -or $CoreWindows -or $CoreUnix), "", "", ""
6060
"Alias", "etsn", "Enter-PSSession", $($FullCLR -or $CoreWindows -or $CoreUnix), "", "", ""
61+
"Alias", "exec", "Switch-Process", $( $CoreUnix), "", "", ""
6162
"Alias", "exsn", "Exit-PSSession", $($FullCLR -or $CoreWindows -or $CoreUnix), "", "", ""
6263
"Alias", "fc", "Format-Custom", $($FullCLR -or $CoreWindows -or $CoreUnix), "ReadOnly", "", ""
6364
"Alias", "fhx", "Format-Hex", $($FullCLR -or $CoreWindows -or $CoreUnix), "", "", ""
@@ -482,6 +483,7 @@ Describe "Verify approved aliases list" -Tags "CI" {
482483
"Cmdlet", "Stop-Transcript", "", $($FullCLR -or $CoreWindows -or $CoreUnix), "", "", "None"
483484
"Cmdlet", "Suspend-Job", "", $($FullCLR ), "", "", ""
484485
"Cmdlet", "Suspend-Service", "", $($FullCLR -or $CoreWindows ), "", "", "Medium"
486+
"Cmdlet", "Switch-Process", "", $( $CoreUnix), "", "", "None"
485487
"Cmdlet", "Tee-Object", "", $($FullCLR -or $CoreWindows -or $CoreUnix), "", "", "Medium"
486488
"Cmdlet", "Test-Connection", "", $( $CoreWindows -or $CoreUnix), "", "", "None"
487489
"Cmdlet", "Test-ComputerSecureChannel", "", $($FullCLR ), "", "", ""

0 commit comments

Comments
 (0)
0