spelling: locals in src/Microsoft.PowerShell.Commands.Management
This commit is contained in:
parent
7c876d4482
commit
281f2a3ea1
|
@ -6264,7 +6264,7 @@ $result
|
||||||
[DllImport("Netapi32.dll", SetLastError = true)]
|
[DllImport("Netapi32.dll", SetLastError = true)]
|
||||||
internal static extern int NetApiBufferFree(IntPtr Buffer);
|
internal static extern int NetApiBufferFree(IntPtr Buffer);
|
||||||
|
|
||||||
internal const int WorkrGroupMachine = 2692;
|
internal const int WorkGroupMachine = 2692;
|
||||||
internal const int MaxMachineNameLength = 15;
|
internal const int MaxMachineNameLength = 15;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -340,8 +340,8 @@ namespace Microsoft.PowerShell.Commands
|
||||||
// When -List is not specified and -Recurse is specified, we need the -Class parameter to compose the right query string
|
// When -List is not specified and -Recurse is specified, we need the -Class parameter to compose the right query string
|
||||||
if (this.Recurse.IsPresent && string.IsNullOrEmpty(Class))
|
if (this.Recurse.IsPresent && string.IsNullOrEmpty(Class))
|
||||||
{
|
{
|
||||||
string errormMsg = string.Format(CultureInfo.InvariantCulture, WmiResources.WmiParameterMissing, "-Class");
|
string errorMsg = string.Format(CultureInfo.InvariantCulture, WmiResources.WmiParameterMissing, "-Class");
|
||||||
ErrorRecord er = new ErrorRecord(new InvalidOperationException(errormMsg), "InvalidOperationException", ErrorCategory.InvalidOperation, null);
|
ErrorRecord er = new ErrorRecord(new InvalidOperationException(errorMsg), "InvalidOperationException", ErrorCategory.InvalidOperation, null);
|
||||||
WriteError(er);
|
WriteError(er);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -683,9 +683,9 @@ namespace Microsoft.PowerShell.Commands
|
||||||
}
|
}
|
||||||
if (RequiredServices.IsPresent)
|
if (RequiredServices.IsPresent)
|
||||||
{
|
{
|
||||||
foreach (ServiceController servdependedon in service.ServicesDependedOn)
|
foreach (ServiceController servicedependedon in service.ServicesDependedOn)
|
||||||
{
|
{
|
||||||
WriteObject(servdependedon);
|
WriteObject(servicedependedon);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -835,12 +835,12 @@ namespace Microsoft.PowerShell.Commands
|
||||||
ArrayList namespaceArray = new ArrayList();
|
ArrayList namespaceArray = new ArrayList();
|
||||||
ArrayList sinkArray = new ArrayList();
|
ArrayList sinkArray = new ArrayList();
|
||||||
ArrayList connectArray = new ArrayList(); // Optimization for remote namespace
|
ArrayList connectArray = new ArrayList(); // Optimization for remote namespace
|
||||||
int currentNamesapceCount = 0;
|
int currentNamespaceCount = 0;
|
||||||
namespaceArray.Add(getObject.Namespace);
|
namespaceArray.Add(getObject.Namespace);
|
||||||
bool topNamespace = true;
|
bool topNamespace = true;
|
||||||
while (currentNamesapceCount < namespaceArray.Count)
|
while (currentNamespaceCount < namespaceArray.Count)
|
||||||
{
|
{
|
||||||
string connectNamespace = (string)namespaceArray[currentNamesapceCount];
|
string connectNamespace = (string)namespaceArray[currentNamespaceCount];
|
||||||
ManagementScope scope = new ManagementScope(WMIHelper.GetScopeString(_computerName, connectNamespace), options);
|
ManagementScope scope = new ManagementScope(WMIHelper.GetScopeString(_computerName, connectNamespace), options);
|
||||||
scope.Connect();
|
scope.Connect();
|
||||||
ManagementClass namespaceClass = new ManagementClass(scope, new ManagementPath("__Namespace"), new ObjectGetOptions());
|
ManagementClass namespaceClass = new ManagementClass(scope, new ManagementPath("__Namespace"), new ObjectGetOptions());
|
||||||
|
@ -861,7 +861,7 @@ namespace Microsoft.PowerShell.Commands
|
||||||
sinkArray.Add(_job.GetNewSink());
|
sinkArray.Add(_job.GetNewSink());
|
||||||
}
|
}
|
||||||
connectArray.Add(scope);
|
connectArray.Add(scope);
|
||||||
currentNamesapceCount++;
|
currentNamespaceCount++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((sinkArray.Count != namespaceArray.Count) || (connectArray.Count != namespaceArray.Count)) // not expected throw exception
|
if ((sinkArray.Count != namespaceArray.Count) || (connectArray.Count != namespaceArray.Count)) // not expected throw exception
|
||||||
|
@ -872,14 +872,14 @@ namespace Microsoft.PowerShell.Commands
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
currentNamesapceCount = 0;
|
currentNamespaceCount = 0;
|
||||||
while (currentNamesapceCount < namespaceArray.Count)
|
while (currentNamespaceCount < namespaceArray.Count)
|
||||||
{
|
{
|
||||||
string connectNamespace = (string)namespaceArray[currentNamesapceCount];
|
string connectNamespace = (string)namespaceArray[currentNamespaceCount];
|
||||||
ManagementObjectSearcher searcher = getObject.GetObjectList((ManagementScope)connectArray[currentNamesapceCount]);
|
ManagementObjectSearcher searcher = getObject.GetObjectList((ManagementScope)connectArray[currentNamespaceCount]);
|
||||||
if (searcher == null)
|
if (searcher == null)
|
||||||
{
|
{
|
||||||
currentNamesapceCount++;
|
currentNamespaceCount++;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (topNamespace)
|
if (topNamespace)
|
||||||
|
@ -889,9 +889,9 @@ namespace Microsoft.PowerShell.Commands
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
searcher.Get((ManagementOperationObserver)sinkArray[currentNamesapceCount]);
|
searcher.Get((ManagementOperationObserver)sinkArray[currentNamespaceCount]);
|
||||||
}
|
}
|
||||||
currentNamesapceCount++;
|
currentNamespaceCount++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -203,7 +203,7 @@ namespace Microsoft.PowerShell.Commands
|
||||||
Assembly webserviceproxy = GenerateWebServiceProxyAssembly(_namespace, _class);
|
Assembly webserviceproxy = GenerateWebServiceProxyAssembly(_namespace, _class);
|
||||||
if (webserviceproxy == null)
|
if (webserviceproxy == null)
|
||||||
return;
|
return;
|
||||||
Object instance = InstantinateWebServiceProxy(webserviceproxy);
|
Object instance = InstantiateWebServiceProxy(webserviceproxy);
|
||||||
|
|
||||||
//to set the credentials into the generated webproxy Object
|
//to set the credentials into the generated webproxy Object
|
||||||
PropertyInfo[] pinfo = instance.GetType().GetProperties();
|
PropertyInfo[] pinfo = instance.GetType().GetProperties();
|
||||||
|
@ -444,7 +444,7 @@ namespace Microsoft.PowerShell.Commands
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="assembly"></param>
|
/// <param name="assembly"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
private object InstantinateWebServiceProxy(Assembly assembly)
|
private object InstantiateWebServiceProxy(Assembly assembly)
|
||||||
{
|
{
|
||||||
Type proxyType = null;
|
Type proxyType = null;
|
||||||
//loop through the types of the assembly and identify the type having
|
//loop through the types of the assembly and identify the type having
|
||||||
|
|
Loading…
Reference in a new issue