diff --git a/src/System.Management.Automation/engine/remoting/client/ClientMethodExecutor.cs b/src/System.Management.Automation/engine/remoting/client/ClientMethodExecutor.cs
index 3defa2f8285..b6c794f5474 100644
--- a/src/System.Management.Automation/engine/remoting/client/ClientMethodExecutor.cs
+++ b/src/System.Management.Automation/engine/remoting/client/ClientMethodExecutor.cs
@@ -132,7 +132,7 @@ internal static void Dispatch(
///
/// Is runspace pushed.
///
- private bool IsRunspacePushed(PSHost host)
+ private static bool IsRunspacePushed(PSHost host)
{
if (!(host is IHostSupportsInteractiveSession host2)) { return false; }
diff --git a/src/System.Management.Automation/engine/remoting/client/ClientRemotePowerShell.cs b/src/System.Management.Automation/engine/remoting/client/ClientRemotePowerShell.cs
index 672fe188da7..faaed378910 100644
--- a/src/System.Management.Automation/engine/remoting/client/ClientRemotePowerShell.cs
+++ b/src/System.Management.Automation/engine/remoting/client/ClientRemotePowerShell.cs
@@ -663,7 +663,7 @@ private void HandleCloseCompleted(object sender, EventArgs args)
}
}
- private bool IsFinished(PSInvocationState state)
+ private static bool IsFinished(PSInvocationState state)
{
return (state == PSInvocationState.Completed ||
state == PSInvocationState.Failed ||
diff --git a/src/System.Management.Automation/engine/remoting/client/Job.cs b/src/System.Management.Automation/engine/remoting/client/Job.cs
index b88e8003945..6ca8ec75f4f 100644
--- a/src/System.Management.Automation/engine/remoting/client/Job.cs
+++ b/src/System.Management.Automation/engine/remoting/client/Job.cs
@@ -2016,7 +2016,7 @@ internal void ConnectJob(Guid runspaceInstanceId)
SubmitAndWaitForConnect(connectJobOperations);
}
- private void SubmitAndWaitForConnect(List connectJobOperations)
+ private static void SubmitAndWaitForConnect(List connectJobOperations)
{
using (ThrottleManager connectThrottleManager = new ThrottleManager())
{
@@ -4122,7 +4122,7 @@ private Pipeline DrainAndBlockRemoteOutput()
return null;
}
- private void RestoreRemoteOutput(Pipeline runningCmd)
+ private static void RestoreRemoteOutput(Pipeline runningCmd)
{
if (runningCmd != null)
{
diff --git a/src/System.Management.Automation/engine/remoting/client/JobManager.cs b/src/System.Management.Automation/engine/remoting/client/JobManager.cs
index b2e4f0d6454..f907cf922d8 100644
--- a/src/System.Management.Automation/engine/remoting/client/JobManager.cs
+++ b/src/System.Management.Automation/engine/remoting/client/JobManager.cs
@@ -616,7 +616,7 @@ private List GetFilteredJobs(
///
///
///
- private bool CheckTypeNames(JobSourceAdapter sourceAdapter, string[] jobSourceAdapterTypes)
+ private static bool CheckTypeNames(JobSourceAdapter sourceAdapter, string[] jobSourceAdapterTypes)
{
// If no type names were specified then allow all adapter types.
if (jobSourceAdapterTypes == null ||
@@ -641,7 +641,7 @@ private bool CheckTypeNames(JobSourceAdapter sourceAdapter, string[] jobSourceAd
return false;
}
- private string GetAdapterName(JobSourceAdapter sourceAdapter)
+ private static string GetAdapterName(JobSourceAdapter sourceAdapter)
{
return (!string.IsNullOrEmpty(sourceAdapter.Name) ?
sourceAdapter.Name :
diff --git a/src/System.Management.Automation/engine/remoting/client/RunspaceRef.cs b/src/System.Management.Automation/engine/remoting/client/RunspaceRef.cs
index 4dfcb01555b..8fb2fc014dc 100644
--- a/src/System.Management.Automation/engine/remoting/client/RunspaceRef.cs
+++ b/src/System.Management.Automation/engine/remoting/client/RunspaceRef.cs
@@ -139,7 +139,7 @@ internal PSCommand CreatePsCommand(string line, bool isScript, bool? useNewScope
///
/// Creates the PSCommand when the runspace is not overridden.
///
- private PSCommand CreatePsCommandNotOverridden(string line, bool isScript, bool? useNewScope)
+ private static PSCommand CreatePsCommandNotOverridden(string line, bool isScript, bool? useNewScope)
{
PSCommand command = new PSCommand();
@@ -407,7 +407,7 @@ private void StartProgressBar(
}
}
- private void StopProgressBar(
+ private static void StopProgressBar(
long sourceId)
{
s_RCProgress.StopProgress(sourceId);
diff --git a/src/System.Management.Automation/engine/remoting/client/clientremotesessionprotocolstatemachine.cs b/src/System.Management.Automation/engine/remoting/client/clientremotesessionprotocolstatemachine.cs
index ca26f32cc5b..719ad4b8499 100644
--- a/src/System.Management.Automation/engine/remoting/client/clientremotesessionprotocolstatemachine.cs
+++ b/src/System.Management.Automation/engine/remoting/client/clientremotesessionprotocolstatemachine.cs
@@ -775,7 +775,7 @@ private void DoFatal(object sender, RemoteSessionStateMachineEventArgs eventArgs
#endregion Event Handlers
- private void CleanAll()
+ private static void CleanAll()
{
}
diff --git a/src/System.Management.Automation/engine/remoting/client/remoterunspaceinfo.cs b/src/System.Management.Automation/engine/remoting/client/remoterunspaceinfo.cs
index 1a975f5a785..ea90e87390b 100644
--- a/src/System.Management.Automation/engine/remoting/client/remoterunspaceinfo.cs
+++ b/src/System.Management.Automation/engine/remoting/client/remoterunspaceinfo.cs
@@ -347,7 +347,7 @@ private string GetTransportName()
///
/// Shell configuration name.
/// Display shell name.
- private string GetDisplayShellName(string shell)
+ private static string GetDisplayShellName(string shell)
{
string shellPrefix = System.Management.Automation.Remoting.Client.WSManNativeApi.ResourceURIPrefix;
int index = shell.IndexOf(shellPrefix, StringComparison.OrdinalIgnoreCase);
diff --git a/src/System.Management.Automation/engine/remoting/commands/CustomShellCommands.cs b/src/System.Management.Automation/engine/remoting/commands/CustomShellCommands.cs
index ae13e4fda76..336108746bf 100644
--- a/src/System.Management.Automation/engine/remoting/commands/CustomShellCommands.cs
+++ b/src/System.Management.Automation/engine/remoting/commands/CustomShellCommands.cs
@@ -641,7 +641,7 @@ protected override void EndProcessing()
/// 1. New shell successfully registered. However cannot delete temporary plugin file {0}.
/// Reason for failure: {1}.
///
- private void DeleteFile(string tmpFileName)
+ private static void DeleteFile(string tmpFileName)
{
Dbg.Assert(!string.IsNullOrEmpty(tmpFileName), "tmpFile cannot be null or empty.");
@@ -693,7 +693,7 @@ private void DeleteFile(string tmpFileName)
/// 2. Cannot write shell configuration data into temporary file {0}. Try again.
/// Reason for failure: {1}.
///
- private string ConstructTemporaryFile(string pluginContent)
+ private static string ConstructTemporaryFile(string pluginContent)
{
// Path.GetTempFileName creates a temporary file whereas GetRandomFileName does not.
string tmpFileName = System.IO.Path.Combine(System.IO.Path.GetTempPath(), System.IO.Path.GetRandomFileName()) + "psshell.xml";
diff --git a/src/System.Management.Automation/engine/remoting/commands/DebugJob.cs b/src/System.Management.Automation/engine/remoting/commands/DebugJob.cs
index 979912619f2..777f56807fe 100644
--- a/src/System.Management.Automation/engine/remoting/commands/DebugJob.cs
+++ b/src/System.Management.Automation/engine/remoting/commands/DebugJob.cs
@@ -237,7 +237,7 @@ private bool CheckForDebuggableJob()
return debuggableJobFound;
}
- private bool GetJobDebuggable(Job job)
+ private static bool GetJobDebuggable(Job job)
{
if (job is IJobDebugger)
{
diff --git a/src/System.Management.Automation/engine/remoting/commands/DisconnectPSSession.cs b/src/System.Management.Automation/engine/remoting/commands/DisconnectPSSession.cs
index 5e4f3b8c129..82459fdab92 100644
--- a/src/System.Management.Automation/engine/remoting/commands/DisconnectPSSession.cs
+++ b/src/System.Management.Automation/engine/remoting/commands/DisconnectPSSession.cs
@@ -363,7 +363,7 @@ private bool ValidateIdleTimeout(PSSession session)
return true;
}
- private string GetLocalhostWithNetworkAccessEnabled(Dictionary psSessions)
+ private static string GetLocalhostWithNetworkAccessEnabled(Dictionary psSessions)
{
System.Text.StringBuilder sb = new System.Text.StringBuilder();
diff --git a/src/System.Management.Automation/engine/remoting/commands/EnterPSHostProcessCommand.cs b/src/System.Management.Automation/engine/remoting/commands/EnterPSHostProcessCommand.cs
index 454cc10efd0..756250eb8d7 100644
--- a/src/System.Management.Automation/engine/remoting/commands/EnterPSHostProcessCommand.cs
+++ b/src/System.Management.Automation/engine/remoting/commands/EnterPSHostProcessCommand.cs
@@ -292,7 +292,7 @@ private Runspace CreateNamedPipeRunspace(NamedPipeConnectionInfo connectionInfo)
return remoteRunspace;
}
- private void PrepareRunspace(Runspace runspace)
+ private static void PrepareRunspace(Runspace runspace)
{
string promptFn = StringUtil.Format(RemotingErrorIdStrings.EnterPSHostProcessPrompt,
@"function global:prompt { """,
@@ -574,7 +574,7 @@ protected override void EndProcessing()
#region Private Methods
- private int[] GetProcIdsFromProcs(Process[] processes)
+ private static int[] GetProcIdsFromProcs(Process[] processes)
{
List returnIds = new List();
foreach (Process process in processes)
@@ -585,7 +585,7 @@ private int[] GetProcIdsFromProcs(Process[] processes)
return returnIds.ToArray();
}
- private int[] GetProcIdsFromNames(string[] names)
+ private static int[] GetProcIdsFromNames(string[] names)
{
if ((names == null) || (names.Length == 0))
{
diff --git a/src/System.Management.Automation/engine/remoting/commands/InvokeCommandCommand.cs b/src/System.Management.Automation/engine/remoting/commands/InvokeCommandCommand.cs
index 677a767d1fd..b60f3131f24 100644
--- a/src/System.Management.Automation/engine/remoting/commands/InvokeCommandCommand.cs
+++ b/src/System.Management.Automation/engine/remoting/commands/InvokeCommandCommand.cs
@@ -1875,7 +1875,7 @@ private void StartProgressBar(
this.Host);
}
- private void StopProgressBar(
+ private static void StopProgressBar(
long sourceId)
{
s_RCProgress.StopProgress(sourceId);
@@ -1954,7 +1954,7 @@ private void DetermineThrowStatementBehavior()
/// Process the stream object before writing it in the specified collection.
///
/// Stream object to process.
- private void PreProcessStreamObject(PSStreamObject streamObject)
+ private static void PreProcessStreamObject(PSStreamObject streamObject)
{
ErrorRecord errorRecord = streamObject.Value as ErrorRecord;
diff --git a/src/System.Management.Automation/engine/remoting/commands/PSRemotingCmdlet.cs b/src/System.Management.Automation/engine/remoting/commands/PSRemotingCmdlet.cs
index 0e422808f1a..4ab6f6e375b 100644
--- a/src/System.Management.Automation/engine/remoting/commands/PSRemotingCmdlet.cs
+++ b/src/System.Management.Automation/engine/remoting/commands/PSRemotingCmdlet.cs
@@ -1879,7 +1879,7 @@ internal Pipeline CreatePipeline(RemoteRunspace remoteRunspace)
///
/// Check the powershell version of the remote server.
///
- private string GetRemoteServerPsVersion(RemoteRunspace remoteRunspace)
+ private static string GetRemoteServerPsVersion(RemoteRunspace remoteRunspace)
{
if (remoteRunspace.ConnectionInfo is NewProcessConnectionInfo)
{
@@ -2427,7 +2427,7 @@ private List