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 @@ -3,4 +3,4 @@

using System.Runtime.CompilerServices;

[assembly:InternalsVisibleTo("Microsoft.Windows.DSC.CoreConfProviders,PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")]
[assembly: InternalsVisibleTo("Microsoft.Windows.DSC.CoreConfProviders,PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")]
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public void GetCimAssociatedInstance(GetCimAssociatedInstanceCommand cmdlet)
foreach (string computerName in computerNames)
{
CimSessionProxy proxy = CreateSessionProxy(computerName, cmdlet.CimInstance, cmdlet);
proxys.Add(proxy);
proxys.Add(proxy);
}

break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ private void SetSessionProxyProperties(
proxy.KeyOnly = getCimInstance.KeyOnly;
proxy.Shallow = getCimInstance.Shallow;
proxy.OperationTimeout = getCimInstance.OperationTimeoutSec;
if(getCimInstance.ResourceUri != null )
if (getCimInstance.ResourceUri != null)
{
proxy.ResourceUri = getCimInstance.ResourceUri;
}
Expand All @@ -394,7 +394,7 @@ private void SetSessionProxyProperties(
{
RemoveCimInstanceCommand removeCimInstance = cmdlet as RemoveCimInstanceCommand;
proxy.OperationTimeout = removeCimInstance.OperationTimeoutSec;
if(removeCimInstance.ResourceUri != null )
if (removeCimInstance.ResourceUri != null)
{
proxy.ResourceUri = removeCimInstance.ResourceUri;
}
Expand All @@ -408,7 +408,7 @@ private void SetSessionProxyProperties(
{
SetCimInstanceCommand setCimInstance = cmdlet as SetCimInstanceCommand;
proxy.OperationTimeout = setCimInstance.OperationTimeoutSec;
if(setCimInstance.ResourceUri != null )
if (setCimInstance.ResourceUri != null)
{
proxy.ResourceUri = setCimInstance.ResourceUri;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ public void Start()
{
DebugHelper.WriteLogEx();

lock(myLock)
lock (myLock)
{
if (status == Status.Default)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ public void InvokeCimMethod(InvokeCimMethodCommand cmdlet)
case CimBaseCommand.ResourceUriComputerSet:
{
string target = string.Format(CultureInfo.CurrentUICulture, targetClass, cmdlet.ClassName);
if(cmdlet.ResourceUri != null )
if (cmdlet.ResourceUri != null)
{
nameSpace = cmdlet.Namespace;
}
Expand Down Expand Up @@ -210,7 +210,7 @@ public void InvokeCimMethod(InvokeCimMethodCommand cmdlet)
case CimBaseCommand.CimInstanceSessionSet:
{
string target = cmdlet.CimInstance.ToString();
if(cmdlet.ResourceUri != null )
if (cmdlet.ResourceUri != null)
{
nameSpace = cmdlet.Namespace;
}
Expand Down Expand Up @@ -280,7 +280,7 @@ private void SetSessionProxyProperties(
InvokeCimMethodCommand cmdlet)
{
proxy.OperationTimeout = cmdlet.OperationTimeoutSec;
if(cmdlet.ResourceUri != null )
if (cmdlet.ResourceUri != null)
{
proxy.ResourceUri = cmdlet.ResourceUri;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ private void SetSessionProxyProperties(
NewCimInstanceCommand cmdlet)
{
proxy.OperationTimeout = cmdlet.OperationTimeoutSec;
if(cmdlet.ResourceUri != null)
if (cmdlet.ResourceUri != null)
{
proxy.ResourceUri = cmdlet.ResourceUri;
}
Expand Down Expand Up @@ -270,7 +270,7 @@ private CimInstance CreateCimInstance(
IDictionary properties,
NewCimInstanceCommand cmdlet)
{
CimInstance cimInstance = new CimInstance(className,cimNamespace);
CimInstance cimInstance = new CimInstance(className, cimNamespace);
if (properties == null)
{
return cimInstance;
Expand Down Expand Up @@ -299,8 +299,8 @@ private CimInstance CreateCimInstance(

DebugHelper.WriteLog("Create and add new property to ciminstance: name = {0}; value = {1}; flags = {2}", 5, propertyName, propertyValue, flag);

PSReference cimReference = propertyValue as PSReference;
if( cimReference != null )
PSReference cimReference = propertyValue as PSReference;
if (cimReference != null)
{
CimProperty newProperty = CimProperty.Create(propertyName, GetBaseObject(cimReference.Value), CimType.Reference, flag);
cimInstance.CimInstanceProperties.Add(newProperty);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public void RemoveCimInstance(RemoveCimInstanceCommand cmdlet)
case CimBaseCommand.CimInstanceComputerSet:
case CimBaseCommand.CimInstanceSessionSet:
string nameSpace = null;
if(cmdlet.ResourceUri != null )
if (cmdlet.ResourceUri != null)
{
nameSpace = GetCimInstanceParameter(cmdlet).CimSystemProperties.Namespace;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -787,7 +787,7 @@ public CimSessionBase()
{
this.sessionState = cimSessions.GetOrAdd(
CurrentRunspaceId,
delegate(Guid instanceId)
delegate (Guid instanceId)
{
if (Runspace.DefaultRunspace != null)
{
Expand Down Expand Up @@ -974,7 +974,7 @@ internal void NewCimSession(NewCimSessionCommand cmdlet,
CimTestCimSessionContext context = new CimTestCimSessionContext(proxy, wrapper);
proxy.ContextObject = context;
// Skip test the connection if user intend to
if(cmdlet.SkipTestConnection.IsPresent)
if (cmdlet.SkipTestConnection.IsPresent)
{
AddSessionToCache(proxy.CimSession, context, new CmdletOperationBase(cmdlet));
}
Expand Down Expand Up @@ -1171,7 +1171,7 @@ public void GetCimSession(GetCimSessionCommand cmdlet)

if (sessionToGet != null)
{
foreach(PSObject psobject in sessionToGet)
foreach (PSObject psobject in sessionToGet)
{
cmdlet.WriteObject(psobject);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,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 Down Expand Up @@ -570,7 +570,7 @@ public Uri ResourceUri
{
DebugHelper.WriteLogEx("ResourceUri {0},", 0, value);

this.options.ResourceUri= value;
this.options.ResourceUri = value;
}

get
Expand Down Expand Up @@ -606,7 +606,7 @@ public bool EnablePromptUser
set
{
DebugHelper.WriteLogEx("EnablePromptUser {0}", 0, value);
if(value)
if (value)
{
this.options.PromptUser = this.PromptUser;
}
Expand Down Expand Up @@ -1876,10 +1876,10 @@ protected void ConsumeCimInvokeMethodResultAsync(
CimResultContext cimResultContext)
{
CimMethodResultObserver observer = new CimMethodResultObserver(this.session, asyncResult, cimResultContext)
{
ClassName = className,
MethodName = methodName
};
{
ClassName = className,
MethodName = methodName
};

observer.OnNewResult += this.ResultEventHandler;
this.operationID = Interlocked.Increment(ref gOperationCounter);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ private bool SetProperty(IDictionary properties, ref CimInstance cimInstance, re
else // For dynamic instance, it is valid to add a new property
{
CimProperty newProperty;
if( value == null )
if (value == null)
{
newProperty = CimProperty.Create(
key,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,15 @@ internal static ErrorRecord ErrorRecordFromAnyException(
if (containsErrorRecord != null)
{
return InitializeErrorRecord(context,
exception : inner,
exception: inner,
errorId: "CimCmdlet_" + containsErrorRecord.ErrorRecord.FullyQualifiedErrorId,
errorCategory: containsErrorRecord.ErrorRecord.CategoryInfo.Category,
cimResultContext: cimResultContext);
}
else
{
return InitializeErrorRecord(context,
exception :inner,
exception: inner,
errorId: "CimCmdlet_" + inner.GetType().Name,
errorCategory: ErrorCategory.NotSpecified,
cimResultContext: cimResultContext);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public string Namespace
[Parameter(ValueFromPipelineByPropertyName = true)]
public UInt32 OperationTimeoutSec
{
get { return operationTimeout;}
get { return operationTimeout; }

set { operationTimeout = value; }
}
Expand All @@ -112,7 +112,7 @@ public UInt32 OperationTimeoutSec
[SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays")]
public CimSession[] CimSession
{
get { return cimSession;}
get { return cimSession; }

set
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public GetCimSessionCommand()
[SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays")]
public string[] ComputerName
{
get { return computername;}
get { return computername; }

set
{
Expand All @@ -80,7 +80,7 @@ public string[] ComputerName
[SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays")]
public UInt32[] Id
{
get { return id;}
get { return id; }

set
{
Expand All @@ -101,7 +101,7 @@ public UInt32[] Id
[SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays")]
public Guid[] InstanceId
{
get { return instanceid;}
get { return instanceid; }

set
{
Expand All @@ -123,7 +123,7 @@ public Guid[] InstanceId
[SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays")]
public string[] Name
{
get { return name;}
get { return name; }

set
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -306,10 +306,11 @@ public SwitchParameter ClientOnly
{
get { return clientOnly; }

set {
set
{
clientOnly = value;
base.SetParameter(value, nameClientOnly);
}
}
}

private SwitchParameter clientOnly;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public sealed class NewCimSessionCommand : CimBaseCommand
ParameterSetName = CredentialParameterSet)]
public PasswordAuthenticationMechanism Authentication
{
get { return authentication;}
get { return authentication; }

set
{
Expand Down Expand Up @@ -88,7 +88,7 @@ public string CertificateThumbprint
[SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays")]
public string[] ComputerName
{
get { return computername;}
get { return computername; }

set { computername = value; }
}
Expand All @@ -109,7 +109,7 @@ public string[] ComputerName
[Parameter(ValueFromPipelineByPropertyName = true)]
public string Name
{
get { return name;}
get { return name; }

set { name = value; }
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
[Cmdlet(
VerbsCommon.Remove,
"CimInstance",
SupportsShouldProcess=true,
SupportsShouldProcess = true,
DefaultParameterSetName = CimBaseCommand.CimInstanceComputerSet,
HelpUri = "https://go.microsoft.com/fwlink/?LinkId=227964")]
public class RemoveCimInstanceCommand : CimBaseCommand
Expand Down Expand Up @@ -143,7 +143,7 @@ public string Namespace
[Parameter]
public UInt32 OperationTimeoutSec
{
get { return operationTimeout;}
get { return operationTimeout; }

set { operationTimeout = value; }
}
Expand Down Expand Up @@ -201,7 +201,7 @@ internal CimInstance CimInstance
ParameterSetName = CimBaseCommand.QuerySessionSet)]
public string Query
{
get { return query;}
get { return query; }

set
{
Expand All @@ -223,7 +223,7 @@ public string Query
ParameterSetName = CimBaseCommand.QueryComputerSet)]
public string QueryDialect
{
get { return querydialect;}
get { return querydialect; }

set
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public RemoveCimSessionCommand()
[SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays")]
public CimSession[] CimSession
{
get { return cimsession;}
get { return cimsession; }

set
{
Expand Down Expand Up @@ -104,7 +104,7 @@ public string[] ComputerName
[SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays")]
public UInt32[] Id
{
get { return id;}
get { return id; }

set
{
Expand All @@ -127,7 +127,7 @@ public UInt32[] Id
[SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays")]
public Guid[] InstanceId
{
get { return instanceid;}
get { return instanceid; }

set
{
Expand All @@ -150,7 +150,7 @@ public Guid[] InstanceId
[SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays")]
public string[] Name
{
get { return name;}
get { return name; }

set
{
Expand Down
Loading