Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ protected void GetCimInstanceInternal(CimBaseCommand cmdlet)
GetComputerName(cmdlet));
string nameSpace;
List<CimSessionProxy> proxys = new();
bool isGetCimInstanceCommand = (cmdlet is GetCimInstanceCommand);
bool isGetCimInstanceCommand = cmdlet is GetCimInstanceCommand;
CimInstance targetCimInstance = null;
switch (cmdlet.ParameterSetName)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -604,7 +604,7 @@ internal IEnumerable<PSObject> QuerySession(IEnumerable<string> nameArray,
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))
Expand Down Expand Up @@ -644,7 +644,7 @@ internal IEnumerable<PSObject> QuerySessionByComputerName(
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))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ public CimSessionProxy(CimSessionProxy proxy)
public CimSessionProxy(string computerName)
{
CreateSetSession(computerName, null, null, null, false);
this.isDefaultSession = (computerName == ConstValue.NullComputerName);
this.isDefaultSession = computerName == ConstValue.NullComputerName;
}

/// <summary>
Expand All @@ -360,7 +360,7 @@ public CimSessionProxy(string computerName)
public CimSessionProxy(string computerName, CimSessionOptions sessionOptions)
{
CreateSetSession(computerName, null, sessionOptions, null, false);
this.isDefaultSession = (computerName == ConstValue.NullComputerName);
this.isDefaultSession = computerName == ConstValue.NullComputerName;
}

/// <summary>
Expand Down Expand Up @@ -403,7 +403,7 @@ public CimSessionProxy(string computerName, CimInstance cimInstance)

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);
}
Expand All @@ -421,7 +421,7 @@ public CimSessionProxy(string computerName, CimInstance cimInstance)
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>
Expand All @@ -436,7 +436,7 @@ public CimSessionProxy(string computerName, CimSessionOptions sessionOptions, Ci
public CimSessionProxy(string computerName, CimOperationOptions operOptions)
{
CreateSetSession(computerName, null, null, operOptions, false);
this.isDefaultSession = (computerName == ConstValue.NullComputerName);
this.isDefaultSession = computerName == ConstValue.NullComputerName;
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ protected override void EndProcessing()
/// </summary>
private CimGetCimClass GetOperationAgent()
{
return (this.AsyncOperation as CimGetCimClass);
return this.AsyncOperation as CimGetCimClass;
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@ protected override void EndProcessing()
/// </summary>
private CimGetInstance GetOperationAgent()
{
return (this.AsyncOperation as CimGetInstance);
return this.AsyncOperation as CimGetInstance;
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ protected override void EndProcessing()
/// </summary>
private CimNewCimInstance GetOperationAgent()
{
return (this.AsyncOperation as CimNewCimInstance);
return this.AsyncOperation as CimNewCimInstance;
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ internal void BuildSessionOptions(out CimSessionOptions outputOptions, out CimCr
outputCredential = null;
if (options != null)
{
DComSessionOptions dcomOptions = (options as DComSessionOptions);
DComSessionOptions dcomOptions = options as DComSessionOptions;
if (dcomOptions != null)
{
bool conflict = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ protected override void EndProcessing()
/// </summary>
private CimRemoveCimInstance GetOperationAgent()
{
return (this.AsyncOperation as CimRemoveCimInstance);
return this.AsyncOperation as CimRemoveCimInstance;
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ protected override void EndProcessing()
/// </summary>
private CimSetCimInstance GetOperationAgent()
{
return (this.AsyncOperation as CimSetCimInstance);
return this.AsyncOperation as CimSetCimInstance;
}

/// <summary>
Expand Down