Fix SA1119 part 1 (#14204)
This commit is contained in:
parent
e6492f9169
commit
bb55515717
|
@ -83,7 +83,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
GetComputerName(cmdlet));
|
||||
string nameSpace;
|
||||
List<CimSessionProxy> proxys = new();
|
||||
bool isGetCimInstanceCommand = (cmdlet is GetCimInstanceCommand);
|
||||
bool isGetCimInstanceCommand = cmdlet is GetCimInstanceCommand;
|
||||
CimInstance targetCimInstance = null;
|
||||
switch (cmdlet.ParameterSetName)
|
||||
{
|
||||
|
|
|
@ -604,7 +604,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
if (pattern.IsMatch(kvp.Key))
|
||||
{
|
||||
HashSet<CimSessionWrapper> wrappers = kvp.Value;
|
||||
foundSession = (wrappers.Count > 0);
|
||||
foundSession = wrappers.Count > 0;
|
||||
foreach (CimSessionWrapper wrapper in wrappers)
|
||||
{
|
||||
if (!sessionIds.Contains(wrapper.SessionId))
|
||||
|
@ -644,7 +644,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
if (this.curCimSessionsByComputerName.ContainsKey(computername))
|
||||
{
|
||||
HashSet<CimSessionWrapper> wrappers = this.curCimSessionsByComputerName[computername];
|
||||
foundSession = (wrappers.Count > 0);
|
||||
foundSession = wrappers.Count > 0;
|
||||
foreach (CimSessionWrapper wrapper in wrappers)
|
||||
{
|
||||
if (!sessionIds.Contains(wrapper.SessionId))
|
||||
|
|
|
@ -344,7 +344,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
public CimSessionProxy(string computerName)
|
||||
{
|
||||
CreateSetSession(computerName, null, null, null, false);
|
||||
this.isDefaultSession = (computerName == ConstValue.NullComputerName);
|
||||
this.isDefaultSession = computerName == ConstValue.NullComputerName;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -360,7 +360,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
public CimSessionProxy(string computerName, CimSessionOptions sessionOptions)
|
||||
{
|
||||
CreateSetSession(computerName, null, sessionOptions, null, false);
|
||||
this.isDefaultSession = (computerName == ConstValue.NullComputerName);
|
||||
this.isDefaultSession = computerName == ConstValue.NullComputerName;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -403,7 +403,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
|
||||
string cimsessionComputerName = cimInstance.GetCimSessionComputerName();
|
||||
CreateSetSession(cimsessionComputerName, null, null, null, false);
|
||||
this.isDefaultSession = (cimsessionComputerName == ConstValue.NullComputerName);
|
||||
this.isDefaultSession = cimsessionComputerName == ConstValue.NullComputerName;
|
||||
|
||||
DebugHelper.WriteLogEx("Create a temp session with computerName = {0}.", 0, cimsessionComputerName);
|
||||
}
|
||||
|
@ -421,7 +421,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
public CimSessionProxy(string computerName, CimSessionOptions sessionOptions, CimOperationOptions operOptions)
|
||||
{
|
||||
CreateSetSession(computerName, null, sessionOptions, operOptions, false);
|
||||
this.isDefaultSession = (computerName == ConstValue.NullComputerName);
|
||||
this.isDefaultSession = computerName == ConstValue.NullComputerName;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -436,7 +436,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
public CimSessionProxy(string computerName, CimOperationOptions operOptions)
|
||||
{
|
||||
CreateSetSession(computerName, null, null, operOptions, false);
|
||||
this.isDefaultSession = (computerName == ConstValue.NullComputerName);
|
||||
this.isDefaultSession = computerName == ConstValue.NullComputerName;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -208,7 +208,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
/// </summary>
|
||||
private CimGetCimClass GetOperationAgent()
|
||||
{
|
||||
return (this.AsyncOperation as CimGetCimClass);
|
||||
return this.AsyncOperation as CimGetCimClass;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -474,7 +474,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
/// </summary>
|
||||
private CimGetInstance GetOperationAgent()
|
||||
{
|
||||
return (this.AsyncOperation as CimGetInstance);
|
||||
return this.AsyncOperation as CimGetInstance;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -371,7 +371,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
/// </summary>
|
||||
private CimNewCimInstance GetOperationAgent()
|
||||
{
|
||||
return (this.AsyncOperation as CimNewCimInstance);
|
||||
return this.AsyncOperation as CimNewCimInstance;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -225,7 +225,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
outputCredential = null;
|
||||
if (options != null)
|
||||
{
|
||||
DComSessionOptions dcomOptions = (options as DComSessionOptions);
|
||||
DComSessionOptions dcomOptions = options as DComSessionOptions;
|
||||
if (dcomOptions != null)
|
||||
{
|
||||
bool conflict = false;
|
||||
|
|
|
@ -273,7 +273,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
/// </summary>
|
||||
private CimRemoveCimInstance GetOperationAgent()
|
||||
{
|
||||
return (this.AsyncOperation as CimRemoveCimInstance);
|
||||
return this.AsyncOperation as CimRemoveCimInstance;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -319,7 +319,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
/// </summary>
|
||||
private CimSetCimInstance GetOperationAgent()
|
||||
{
|
||||
return (this.AsyncOperation as CimSetCimInstance);
|
||||
return this.AsyncOperation as CimSetCimInstance;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
Loading…
Reference in a new issue