mirror of
https://github.com/aphrody-labs/PowerShell.git
synced 2026-10-17 04:36:39 +00:00
commit
7a89b33f8b
134 files changed
+539
-539
No files matched your search
@@ -855,7 +855,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
||||
/// <summary>
|
||||
/// certificate parameter set
|
||||
/// </summary>
|
||||
internal const string CertificatePrameterSet = "CertificatePrameterSet";
|
||||
internal const string CertificateParameterSet = "CertificateParameterSet";
|
||||
|
||||
/// <summary>
|
||||
/// CimInstance parameter alias
|
||||
|
||||
@@ -220,7 +220,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
||||
this.nameSpace = theNameSpace;
|
||||
this.queryDialect = ConstValue.GetQueryDialectWithDefault(theQueryDialect);
|
||||
this.queryExpression = theQueryExpression;
|
||||
this.opreationTimeout = theOpreationTimeout;
|
||||
this.operationTimeout = theOpreationTimeout;
|
||||
this.computerName = theComputerName;
|
||||
}
|
||||
|
||||
@@ -299,7 +299,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
||||
this.nameSpace,
|
||||
this.queryDialect,
|
||||
this.queryExpression,
|
||||
this.opreationTimeout);
|
||||
this.operationTimeout);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -308,7 +308,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
||||
this.nameSpace,
|
||||
this.queryDialect,
|
||||
this.queryExpression,
|
||||
this.opreationTimeout);
|
||||
this.operationTimeout);
|
||||
}
|
||||
status = Status.Started;
|
||||
}
|
||||
@@ -392,7 +392,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
||||
private string nameSpace;
|
||||
private string queryDialect;
|
||||
private string queryExpression;
|
||||
private UInt32 opreationTimeout;
|
||||
private UInt32 operationTimeout;
|
||||
#endregion
|
||||
#endregion
|
||||
}
|
||||
|
||||
@@ -971,8 +971,8 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
||||
|
||||
CimTestCimSessionContext testCimSessionContext = context as CimTestCimSessionContext;
|
||||
UInt32 sessionId = this.sessionState.GenerateSessionId();
|
||||
string orginalSessioName = testCimSessionContext.CimSessionWrapper.Name;
|
||||
string sessionName = (orginalSessioName != null) ? orginalSessioName : String.Format(CultureInfo.CurrentUICulture, @"{0}{1}", CimSessionState.CimSessionClassName, sessionId);
|
||||
string originalSessionName = testCimSessionContext.CimSessionWrapper.Name;
|
||||
string sessionName = (originalSessionName != null) ? originalSessionName : String.Format(CultureInfo.CurrentUICulture, @"{0}{1}", CimSessionState.CimSessionClassName, sessionId);
|
||||
|
||||
// detach CimSession from the proxy object
|
||||
CimSession createdCimSession = testCimSessionContext.Proxy.Detach();
|
||||
|
||||
@@ -141,17 +141,17 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
||||
}
|
||||
|
||||
Exception exception = null;
|
||||
CimInstance intance = cmdlet.CimInstance;
|
||||
CimInstance instance = cmdlet.CimInstance;
|
||||
// For CimInstance parameter sets, Property is an optional parameter
|
||||
if (cmdlet.Property != null)
|
||||
{
|
||||
if (!SetProperty(cmdlet.Property, ref intance, ref exception))
|
||||
if (!SetProperty(cmdlet.Property, ref instance, ref exception))
|
||||
{
|
||||
cmdlet.ThrowTerminatingError(exception, action);
|
||||
return;
|
||||
}
|
||||
}
|
||||
proxy.ModifyInstanceAsync(nameSpace, intance);
|
||||
proxy.ModifyInstanceAsync(nameSpace, instance);
|
||||
}
|
||||
break;
|
||||
case CimBaseCommand.QueryComputerSet:
|
||||
|
||||
@@ -64,7 +64,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
||||
/// This is specificly for wsman protocol.
|
||||
/// </summary>
|
||||
[Parameter(ValueFromPipelineByPropertyName = true,
|
||||
ParameterSetName = CertificatePrameterSet)]
|
||||
ParameterSetName = CertificateParameterSet)]
|
||||
public String CertificateThumbprint
|
||||
{
|
||||
get { return certificatethumbprint; }
|
||||
|
||||
@@ -157,11 +157,11 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
||||
/// <summary>
|
||||
/// Flag used to control generating message into powershell
|
||||
/// </summary>
|
||||
private static bool genrateVerboseMessage = true;
|
||||
internal static bool GenrateVerboseMessage
|
||||
private static bool generateVerboseMessage = true;
|
||||
internal static bool GenerateVerboseMessage
|
||||
{
|
||||
get { return genrateVerboseMessage; }
|
||||
set { genrateVerboseMessage = value; }
|
||||
get { return generateVerboseMessage; }
|
||||
set { generateVerboseMessage = value; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -203,7 +203,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
||||
internal static string removeParameterSetName = @"Remove parameter set {0} name from cache";
|
||||
internal static string currentParameterSetNameCount = @"Cache have {0} parameter set names";
|
||||
internal static string currentParameterSetNameInCache = @"Cache have parameter set {0} valid {1}";
|
||||
internal static string currentnonMadatoryParameterSetInCache = @"Cache have optional parameter set {0} valid {1}";
|
||||
internal static string currentnonMandatoryParameterSetInCache = @"Cache have optional parameter set {0} valid {1}";
|
||||
internal static string optionalParameterSetNameCount = @"Cache have {0} optional parameter set names";
|
||||
internal static string finalParameterSetName = @"------Final parameter set name of the cmdlet is {0}";
|
||||
internal static string addToOptionalParameterSet = @"Add to optional ParameterSetNames {0}";
|
||||
|
||||
+2
-2
@@ -228,9 +228,9 @@ namespace Microsoft.PackageManagement.Msi.Internal.Deployment.WindowsInstaller.L
|
||||
return q;
|
||||
}
|
||||
|
||||
private static LambdaExpression GetJoinLambda(Expression expresion)
|
||||
private static LambdaExpression GetJoinLambda(Expression expression)
|
||||
{
|
||||
UnaryExpression unaryExpression = (UnaryExpression) expresion;
|
||||
UnaryExpression unaryExpression = (UnaryExpression) expression;
|
||||
return (LambdaExpression) unaryExpression.Operand;
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -312,9 +312,9 @@ namespace Microsoft.PackageManagement.Msi.Internal.Deployment.WindowsInstaller.L
|
||||
return this.CreateQuery<T>(expression);
|
||||
}
|
||||
|
||||
private static LambdaExpression GetJoinLambda(Expression expresion)
|
||||
private static LambdaExpression GetJoinLambda(Expression expression)
|
||||
{
|
||||
UnaryExpression unaryExpression = (UnaryExpression) expresion;
|
||||
UnaryExpression unaryExpression = (UnaryExpression) expression;
|
||||
return (LambdaExpression) unaryExpression.Operand;
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -154,7 +154,7 @@ namespace Microsoft.PackageManagement.PackageSourceListProvider
|
||||
var provider = request.PackageManagementService.GetAvailableProviders(request, new[] {"NuGet"}).FirstOrDefault();
|
||||
if (provider != null)
|
||||
{
|
||||
var donwloadrequest = PackageSourceListRequest.ExtendRequest(
|
||||
var downloadrequest = PackageSourceListRequest.ExtendRequest(
|
||||
new Dictionary<string, string[]>
|
||||
{
|
||||
{"Destination", new[] {package.Destination ?? ""}}
|
||||
@@ -163,7 +163,7 @@ namespace Microsoft.PackageManagement.PackageSourceListProvider
|
||||
package.IsTrustedSource,
|
||||
request);
|
||||
|
||||
var downloading = provider.DownloadPackage(pkgs[0], location, donwloadrequest);
|
||||
var downloading = provider.DownloadPackage(pkgs[0], location, downloadrequest);
|
||||
|
||||
foreach (var i in downloading)
|
||||
{
|
||||
|
||||
+4
-4
@@ -97,7 +97,7 @@ namespace Microsoft.PackageManagement.PackageSourceListProvider
|
||||
}
|
||||
}
|
||||
|
||||
internal string DefaultCatlogFileLocation
|
||||
internal string DefaultCatalogFileLocation
|
||||
{
|
||||
get
|
||||
{
|
||||
@@ -970,9 +970,9 @@ namespace Microsoft.PackageManagement.PackageSourceListProvider
|
||||
if (force || this.ShouldContinue(Resources.Messages.QueryDownloadPackageSourceList.format(DefaultJSONSourceLocation), Resources.Messages.PackageSourceListNotFound.format(DefaultJSONFileLocation)))
|
||||
{
|
||||
WebDownloader.DownloadFile(DefaultJSONSourceLocation, DefaultJSONFileLocation, this, null);
|
||||
WebDownloader.DownloadFile(DefaultJSONCatalogFileLocation, DefaultCatlogFileLocation, this, null);
|
||||
if (System.IO.File.Exists(DefaultJSONFileLocation) && System.IO.File.Exists(DefaultCatlogFileLocation) &&
|
||||
PackageSourceListProvider.TestCatalogFile(DefaultJSONFileLocation, DefaultCatlogFileLocation, this))
|
||||
WebDownloader.DownloadFile(DefaultJSONCatalogFileLocation, DefaultCatalogFileLocation, this, null);
|
||||
if (System.IO.File.Exists(DefaultJSONFileLocation) && System.IO.File.Exists(DefaultCatalogFileLocation) &&
|
||||
PackageSourceListProvider.TestCatalogFile(DefaultJSONFileLocation, DefaultCatalogFileLocation, this))
|
||||
{
|
||||
addDefaultConfig = true;
|
||||
}
|
||||
|
||||
+3
-3
@@ -92,7 +92,7 @@ namespace Microsoft.PackageManagement.PackageSourceListProvider
|
||||
return;
|
||||
}
|
||||
|
||||
int packagesRecevied = 0;
|
||||
int packagesReceived = 0;
|
||||
foreach (var i in installing)
|
||||
{
|
||||
request.YieldSoftwareIdentity(i.FastPackageReference, i.Name, i.Version, i.VersionScheme, i.Summary, i.Source, i.SearchKey, i.FullPath, i.PackageFilename);
|
||||
@@ -111,10 +111,10 @@ namespace Microsoft.PackageManagement.PackageSourceListProvider
|
||||
request.PackageManagementService.ImportPackageProvider(request, packageJson.Name, null, null, null, isRooted: false, force: false);
|
||||
}
|
||||
}
|
||||
packagesRecevied++;
|
||||
packagesReceived++;
|
||||
}
|
||||
|
||||
request.Verbose(Resources.Messages.NumberOfPackagesRecevied, packagesRecevied, provider.Name, "install-package");
|
||||
request.Verbose(Resources.Messages.NumberOfPackagesRecevied, packagesReceived, provider.Name, "install-package");
|
||||
}
|
||||
|
||||
internal static void GeInstalledPowershellArtifacts(PackageJson package, string requiredVersion, string minimumVersion, string maximumVersion, Dictionary<string, SoftwareIdentity> fastPackReftable, PackageSourceListRequest request)
|
||||
|
||||
@@ -6264,7 +6264,7 @@ $result
|
||||
[DllImport("Netapi32.dll", SetLastError = true)]
|
||||
internal static extern int NetApiBufferFree(IntPtr Buffer);
|
||||
|
||||
internal const int WorkrGroupMachine = 2692;
|
||||
internal const int WorkGroupMachine = 2692;
|
||||
internal const int MaxMachineNameLength = 15;
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -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
|
||||
if (this.Recurse.IsPresent && string.IsNullOrEmpty(Class))
|
||||
{
|
||||
string errormMsg = string.Format(CultureInfo.InvariantCulture, WmiResources.WmiParameterMissing, "-Class");
|
||||
ErrorRecord er = new ErrorRecord(new InvalidOperationException(errormMsg), "InvalidOperationException", ErrorCategory.InvalidOperation, null);
|
||||
string errorMsg = string.Format(CultureInfo.InvariantCulture, WmiResources.WmiParameterMissing, "-Class");
|
||||
ErrorRecord er = new ErrorRecord(new InvalidOperationException(errorMsg), "InvalidOperationException", ErrorCategory.InvalidOperation, null);
|
||||
WriteError(er);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -683,9 +683,9 @@ namespace Microsoft.PowerShell.Commands
|
||||
}
|
||||
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 sinkArray = new ArrayList();
|
||||
ArrayList connectArray = new ArrayList(); // Optimization for remote namespace
|
||||
int currentNamesapceCount = 0;
|
||||
int currentNamespaceCount = 0;
|
||||
namespaceArray.Add(getObject.Namespace);
|
||||
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);
|
||||
scope.Connect();
|
||||
ManagementClass namespaceClass = new ManagementClass(scope, new ManagementPath("__Namespace"), new ObjectGetOptions());
|
||||
@@ -861,7 +861,7 @@ namespace Microsoft.PowerShell.Commands
|
||||
sinkArray.Add(_job.GetNewSink());
|
||||
}
|
||||
connectArray.Add(scope);
|
||||
currentNamesapceCount++;
|
||||
currentNamespaceCount++;
|
||||
}
|
||||
|
||||
if ((sinkArray.Count != namespaceArray.Count) || (connectArray.Count != namespaceArray.Count)) // not expected throw exception
|
||||
@@ -872,14 +872,14 @@ namespace Microsoft.PowerShell.Commands
|
||||
return;
|
||||
}
|
||||
|
||||
currentNamesapceCount = 0;
|
||||
while (currentNamesapceCount < namespaceArray.Count)
|
||||
currentNamespaceCount = 0;
|
||||
while (currentNamespaceCount < namespaceArray.Count)
|
||||
{
|
||||
string connectNamespace = (string)namespaceArray[currentNamesapceCount];
|
||||
ManagementObjectSearcher searcher = getObject.GetObjectList((ManagementScope)connectArray[currentNamesapceCount]);
|
||||
string connectNamespace = (string)namespaceArray[currentNamespaceCount];
|
||||
ManagementObjectSearcher searcher = getObject.GetObjectList((ManagementScope)connectArray[currentNamespaceCount]);
|
||||
if (searcher == null)
|
||||
{
|
||||
currentNamesapceCount++;
|
||||
currentNamespaceCount++;
|
||||
continue;
|
||||
}
|
||||
if (topNamespace)
|
||||
@@ -889,9 +889,9 @@ namespace Microsoft.PowerShell.Commands
|
||||
}
|
||||
else
|
||||
{
|
||||
searcher.Get((ManagementOperationObserver)sinkArray[currentNamesapceCount]);
|
||||
searcher.Get((ManagementOperationObserver)sinkArray[currentNamespaceCount]);
|
||||
}
|
||||
currentNamesapceCount++;
|
||||
currentNamespaceCount++;
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
@@ -203,7 +203,7 @@ namespace Microsoft.PowerShell.Commands
|
||||
Assembly webserviceproxy = GenerateWebServiceProxyAssembly(_namespace, _class);
|
||||
if (webserviceproxy == null)
|
||||
return;
|
||||
Object instance = InstantinateWebServiceProxy(webserviceproxy);
|
||||
Object instance = InstantiateWebServiceProxy(webserviceproxy);
|
||||
|
||||
//to set the credentials into the generated webproxy Object
|
||||
PropertyInfo[] pinfo = instance.GetType().GetProperties();
|
||||
@@ -444,7 +444,7 @@ namespace Microsoft.PowerShell.Commands
|
||||
/// </summary>
|
||||
/// <param name="assembly"></param>
|
||||
/// <returns></returns>
|
||||
private object InstantinateWebServiceProxy(Assembly assembly)
|
||||
private object InstantiateWebServiceProxy(Assembly assembly)
|
||||
{
|
||||
Type proxyType = null;
|
||||
//loop through the types of the assembly and identify the type having
|
||||
|
||||
@@ -214,7 +214,7 @@ namespace Microsoft.PowerShell.Commands
|
||||
/// </summary>
|
||||
[Parameter]
|
||||
public SwitchParameter Append { get; set; }
|
||||
private bool _isActuallyAppending; // true if Append=true AND the file written was not empty (or nonexistant) when the cmdlet was invoked
|
||||
private bool _isActuallyAppending; // true if Append=true AND the file written was not empty (or nonexistent) when the cmdlet was invoked
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ namespace Microsoft.PowerShell.Commands
|
||||
// Debugging to persist until Ctrl+C or Debugger 'Exit' stops cmdlet.
|
||||
private bool _debugging;
|
||||
private ManualResetEventSlim _newRunningScriptEvent = new ManualResetEventSlim(true);
|
||||
private RunspaceAvailability _previousRunspaceAvailablity = RunspaceAvailability.None;
|
||||
private RunspaceAvailability _previousRunspaceAvailability = RunspaceAvailability.None;
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -409,8 +409,8 @@ namespace Microsoft.PowerShell.Commands
|
||||
}
|
||||
}
|
||||
|
||||
RunspaceAvailability prevAvailability = _previousRunspaceAvailablity;
|
||||
_previousRunspaceAvailablity = e.RunspaceAvailability;
|
||||
RunspaceAvailability prevAvailability = _previousRunspaceAvailability;
|
||||
_previousRunspaceAvailability = e.RunspaceAvailability;
|
||||
|
||||
if ((e.RunspaceAvailability == RunspaceAvailability.Available) || (e.RunspaceAvailability == RunspaceAvailability.None))
|
||||
{
|
||||
|
||||
+3
-3
@@ -225,7 +225,7 @@ namespace Microsoft.PowerShell.Commands.Internal.Format
|
||||
// Use the MarginBounds on the event to do this
|
||||
float linesPerPage = ev.MarginBounds.Height / _printFont.GetHeight(ev.Graphics);
|
||||
|
||||
if (!_printingInitalized)
|
||||
if (!_printingInitialized)
|
||||
{
|
||||
// on the first page we have to initialize the metrics for LineOutput
|
||||
|
||||
@@ -234,7 +234,7 @@ namespace Microsoft.PowerShell.Commands.Internal.Format
|
||||
float w = ev.Graphics.MeasureString(s, _printFont).Width / s.Length;
|
||||
float columnsPerPage = ev.MarginBounds.Width / w;
|
||||
|
||||
_printingInitalized = true;
|
||||
_printingInitialized = true;
|
||||
_deviceRows = (int)linesPerPage;
|
||||
_deviceColumns = (int)columnsPerPage;
|
||||
|
||||
@@ -268,7 +268,7 @@ namespace Microsoft.PowerShell.Commands.Internal.Format
|
||||
/// <summary>
|
||||
/// flag for one time initialization of the interface (columns, etc.)
|
||||
/// </summary>
|
||||
private bool _printingInitalized = false;
|
||||
private bool _printingInitialized = false;
|
||||
|
||||
/// <summary>
|
||||
/// callback to ask the outputter to playback its cache
|
||||
|
||||
+2
-2
@@ -55,7 +55,7 @@ namespace Microsoft.PowerShell.Commands
|
||||
request.Headers.Clear();
|
||||
foreach (string key in WebSession.Headers.Keys)
|
||||
{
|
||||
bool setHeaderViaProperty = TryMapHeaaderToProperty(webRequest, key);
|
||||
bool setHeaderViaProperty = TryMapHeaderToProperty(webRequest, key);
|
||||
|
||||
if (!setHeaderViaProperty)
|
||||
{
|
||||
@@ -150,7 +150,7 @@ namespace Microsoft.PowerShell.Commands
|
||||
return (request);
|
||||
}
|
||||
|
||||
private bool TryMapHeaaderToProperty(HttpWebRequest webRequest, string key)
|
||||
private bool TryMapHeaderToProperty(HttpWebRequest webRequest, string key)
|
||||
{
|
||||
bool setHeaderViaProperty = false;
|
||||
|
||||
|
||||
@@ -361,15 +361,15 @@ namespace Microsoft.PowerShell.Commands
|
||||
PSObject result = new PSObject();
|
||||
if (matchedProperties.Count != 0)
|
||||
{
|
||||
HashSet<string> propertNames = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
|
||||
HashSet<string> propertyNames = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
|
||||
|
||||
foreach (PSNoteProperty noteProperty in matchedProperties)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!propertNames.Contains(noteProperty.Name))
|
||||
if (!propertyNames.Contains(noteProperty.Name))
|
||||
{
|
||||
propertNames.Add(noteProperty.Name);
|
||||
propertyNames.Add(noteProperty.Name);
|
||||
result.Properties.Add(noteProperty);
|
||||
}
|
||||
else
|
||||
|
||||
@@ -860,9 +860,9 @@ namespace Microsoft.PowerShell
|
||||
ConsoleControl.INPUT_RECORD[] inputRecords =
|
||||
new ConsoleControl.INPUT_RECORD[ConsoleControl.GetNumberOfConsoleInputEvents(handle)];
|
||||
|
||||
int acutalNumberOfInputRecords = ConsoleControl.PeekConsoleInput(handle, ref inputRecords);
|
||||
int actualNumberOfInputRecords = ConsoleControl.PeekConsoleInput(handle, ref inputRecords);
|
||||
|
||||
for (int i = 0; i < acutalNumberOfInputRecords; i++)
|
||||
for (int i = 0; i < actualNumberOfInputRecords; i++)
|
||||
{
|
||||
if (((ConsoleControl.InputRecordEventTypes)inputRecords[i].EventType) ==
|
||||
ConsoleControl.InputRecordEventTypes.KEY_EVENT)
|
||||
|
||||
@@ -31,7 +31,7 @@ namespace System.Diagnostics.Eventing
|
||||
private static Guid t_activityId;
|
||||
|
||||
private const int s_basicTypeAllocationBufferSize = 16;
|
||||
private const int s_etwMaxMumberArguments = 32;
|
||||
private const int s_etwMaxNumberArguments = 32;
|
||||
private const int s_etwAPIMaxStringCount = 8;
|
||||
private const int s_maxEventDataDescriptors = 128;
|
||||
private const int s_traceEventMaximumSize = 65482;
|
||||
@@ -625,13 +625,13 @@ namespace System.Diagnostics.Eventing
|
||||
if ((eventPayload != null) && (eventPayload.Length != 0))
|
||||
{
|
||||
argCount = eventPayload.Length;
|
||||
if (argCount > s_etwMaxMumberArguments)
|
||||
if (argCount > s_etwMaxNumberArguments)
|
||||
{
|
||||
//
|
||||
//too many arguments to log
|
||||
//
|
||||
throw new ArgumentOutOfRangeException("eventPayload",
|
||||
string.Format(CultureInfo.CurrentCulture, DotNetEventingStrings.ArgumentOutOfRange_MaxArgExceeded, s_etwMaxMumberArguments));
|
||||
string.Format(CultureInfo.CurrentCulture, DotNetEventingStrings.ArgumentOutOfRange_MaxArgExceeded, s_etwMaxNumberArguments));
|
||||
}
|
||||
|
||||
uint totalEventSize = 0;
|
||||
|
||||
@@ -248,12 +248,12 @@ namespace Microsoft.Management.UI.Internal
|
||||
/// Splits the string adding indentation before each line
|
||||
/// </summary>
|
||||
/// <param name="str">string to add indentation to</param>
|
||||
/// <param name="numberOfIdents">number of indentations</param>
|
||||
/// <param name="numberOfIndents">number of indentations</param>
|
||||
/// <returns>the string indented</returns>
|
||||
private static string AddIndent(string str, int numberOfIdents)
|
||||
private static string AddIndent(string str, int numberOfIndents)
|
||||
{
|
||||
StringBuilder indent = new StringBuilder();
|
||||
indent.Append(' ', numberOfIdents * HelpParagraphBuilder.IndentSize);
|
||||
indent.Append(' ', numberOfIndents * HelpParagraphBuilder.IndentSize);
|
||||
return HelpParagraphBuilder.AddIndent(str, indent.ToString());
|
||||
}
|
||||
|
||||
@@ -421,22 +421,22 @@ namespace Microsoft.Management.UI.Internal
|
||||
parameterNameOptionalCloseBrace = "]";
|
||||
}
|
||||
|
||||
string paramterPrefix = String.Format(
|
||||
string parameterPrefix = String.Format(
|
||||
CultureInfo.CurrentCulture,
|
||||
"{0}{1}-",
|
||||
parameterOptionalOpenBrace,
|
||||
parameterNameOptionalOpenBrace);
|
||||
|
||||
this.AddText(paramterPrefix, false);
|
||||
this.AddText(parameterPrefix, false);
|
||||
this.AddText(parameterName, true);
|
||||
|
||||
string paramterSuffix = String.Format(
|
||||
string parameterSuffix = String.Format(
|
||||
CultureInfo.CurrentCulture,
|
||||
"{0} {1}{2} ",
|
||||
parameterNameOptionalCloseBrace,
|
||||
parameterType,
|
||||
parameterOptionalCloseBrace);
|
||||
this.AddText(paramterSuffix, false);
|
||||
this.AddText(parameterSuffix, false);
|
||||
}
|
||||
|
||||
string commonParametersText = String.Format(
|
||||
|
||||
@@ -31,7 +31,7 @@ namespace Microsoft.Management.UI.Internal
|
||||
/// <summary>
|
||||
/// The text spans that should be highlighted
|
||||
/// </summary>
|
||||
private List<TextSpan> highlighedSpans;
|
||||
private List<TextSpan> highlightedSpans;
|
||||
|
||||
/// <summary>
|
||||
/// The text displayed
|
||||
@@ -56,7 +56,7 @@ namespace Microsoft.Management.UI.Internal
|
||||
|
||||
this.paragraph = paragraph;
|
||||
this.boldSpans = new List<TextSpan>();
|
||||
this.highlighedSpans = new List<TextSpan>();
|
||||
this.highlightedSpans = new List<TextSpan>();
|
||||
this.textBuilder = new StringBuilder();
|
||||
}
|
||||
|
||||
@@ -72,7 +72,7 @@ namespace Microsoft.Management.UI.Internal
|
||||
/// </summary>
|
||||
internal int HighlightCount
|
||||
{
|
||||
get { return this.highlighedSpans.Count; }
|
||||
get { return this.highlightedSpans.Count; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -100,7 +100,7 @@ namespace Microsoft.Management.UI.Internal
|
||||
int currentBoldIndex = 0;
|
||||
TextSpan? currentBoldSpan = this.boldSpans.Count == 0 ? (TextSpan?)null : this.boldSpans[0];
|
||||
int currentHighlightedIndex = 0;
|
||||
TextSpan? currentHighlightedSpan = this.highlighedSpans.Count == 0 ? (TextSpan?)null : this.highlighedSpans[0];
|
||||
TextSpan? currentHighlightedSpan = this.highlightedSpans.Count == 0 ? (TextSpan?)null : this.highlightedSpans[0];
|
||||
|
||||
bool currentBold = false;
|
||||
bool currentHighlighted = false;
|
||||
@@ -115,7 +115,7 @@ namespace Microsoft.Management.UI.Internal
|
||||
ParagraphBuilder.MoveSpanToPosition(ref currentBoldIndex, ref currentBoldSpan, i, this.boldSpans);
|
||||
newBold = currentBoldSpan == null ? false : currentBoldSpan.Value.Contains(i);
|
||||
|
||||
ParagraphBuilder.MoveSpanToPosition(ref currentHighlightedIndex, ref currentHighlightedSpan, i, this.highlighedSpans);
|
||||
ParagraphBuilder.MoveSpanToPosition(ref currentHighlightedIndex, ref currentHighlightedSpan, i, this.highlightedSpans);
|
||||
newHighlighted = currentHighlightedSpan == null ? false : currentHighlightedSpan.Value.Contains(i);
|
||||
|
||||
if (newBold != currentBold || newHighlighted != currentHighlighted)
|
||||
@@ -142,7 +142,7 @@ namespace Microsoft.Management.UI.Internal
|
||||
/// <param name="wholeWord">true if we should search whole word only</param>
|
||||
internal void HighlightAllInstancesOf(string search, bool caseSensitive, bool wholeWord)
|
||||
{
|
||||
this.highlighedSpans.Clear();
|
||||
this.highlightedSpans.Clear();
|
||||
|
||||
if (search == null || search.Trim().Length == 0)
|
||||
{
|
||||
@@ -216,7 +216,7 @@ namespace Microsoft.Management.UI.Internal
|
||||
internal void ResetAllText()
|
||||
{
|
||||
this.boldSpans.Clear();
|
||||
this.highlighedSpans.Clear();
|
||||
this.highlightedSpans.Clear();
|
||||
this.textBuilder.Clear();
|
||||
}
|
||||
|
||||
@@ -298,7 +298,7 @@ namespace Microsoft.Management.UI.Internal
|
||||
throw new ArgumentOutOfRangeException("length");
|
||||
}
|
||||
|
||||
this.highlighedSpans.Add(new TextSpan(start, length));
|
||||
this.highlightedSpans.Add(new TextSpan(start, length));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -70,7 +70,7 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
|
||||
/// <summary>
|
||||
/// Field used for the CommonParameters parameter.
|
||||
/// </summary>
|
||||
private ParameterSetViewModel comonParameters;
|
||||
private ParameterSetViewModel commonParameters;
|
||||
|
||||
/// <summary>
|
||||
/// The ShowCommandCommandInfo this model is based on
|
||||
@@ -239,7 +239,7 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
|
||||
/// </summary>
|
||||
public ParameterSetViewModel CommonParameters
|
||||
{
|
||||
get { return this.comonParameters; }
|
||||
get { return this.commonParameters; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -537,7 +537,7 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
|
||||
}
|
||||
|
||||
List<ParameterViewModel> commonParametersList = commonParametersTable.Values.ToList<ParameterViewModel>();
|
||||
returnValue.comonParameters = new ParameterSetViewModel(String.Empty, commonParametersList);
|
||||
returnValue.commonParameters = new ParameterSetViewModel(String.Empty, commonParametersList);
|
||||
|
||||
returnValue.parameterSets.Sort(returnValue.Compare);
|
||||
|
||||
|
||||
@@ -80,8 +80,8 @@ namespace Microsoft.PowerShell.PackageManagement.Cmdlets {
|
||||
// this dep is not processed yet
|
||||
if (!processedDependencies.Contains(dep))
|
||||
{
|
||||
var dependendcies = PackageManagementService.FindPackageByCanonicalId(dep, this);
|
||||
var depPkg = dependendcies.OrderByDescending(pp => pp, SoftwareIdentityVersionComparer.Instance).FirstOrDefault();
|
||||
var dependencies = PackageManagementService.FindPackageByCanonicalId(dep, this);
|
||||
var depPkg = dependencies.OrderByDescending(pp => pp, SoftwareIdentityVersionComparer.Instance).FirstOrDefault();
|
||||
|
||||
processedDependencies.Add(dep);
|
||||
|
||||
|
||||
@@ -163,8 +163,8 @@ namespace Microsoft.PowerShell.PackageManagement.Cmdlets
|
||||
if (IncludeDependencies) {
|
||||
var missingDependencies = new HashSet<string>();
|
||||
foreach (var dep in package.Dependencies) {
|
||||
var dependendcies = PackageManagementService.FindPackageByCanonicalId(dep, this);
|
||||
var depPkg = dependendcies.OrderByDescending(pp => pp, SoftwareIdentityVersionComparer.Instance).FirstOrDefault();
|
||||
var dependencies = PackageManagementService.FindPackageByCanonicalId(dep, this);
|
||||
var depPkg = dependencies.OrderByDescending(pp => pp, SoftwareIdentityVersionComparer.Instance).FirstOrDefault();
|
||||
|
||||
if (depPkg == null) {
|
||||
missingDependencies.Add(dep);
|
||||
|
||||
@@ -237,8 +237,8 @@ namespace Microsoft.PowerShell.PackageManagement.Cmdlets
|
||||
foreach (var dep in package.Dependencies) {
|
||||
// note: future work may be needed if the package sources currently selected by the user don't
|
||||
// contain the dependencies.
|
||||
var dependendcies = PackageManagementService.FindPackageByCanonicalId(dep, this);
|
||||
foreach (var depPackage in dependendcies) {
|
||||
var dependencies = PackageManagementService.FindPackageByCanonicalId(dep, this);
|
||||
foreach (var depPackage in dependencies) {
|
||||
ProcessPackage(depPackage.Provider, searchKey.Select(each => each + depPackage.Name).ToArray(), depPackage);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -82,7 +82,7 @@ namespace Microsoft.PowerShell.PackageManagement.Utility {
|
||||
}
|
||||
|
||||
[SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "Required.")]
|
||||
internal static IHostApi SuprressBootstrapping(this IHostApi parent, bool isProcessing) {
|
||||
internal static IHostApi SuppressBootstrapping(this IHostApi parent, bool isProcessing) {
|
||||
return new object[] {
|
||||
new {
|
||||
IsInvocation = new Func<bool>(() => false),
|
||||
|
||||
@@ -324,7 +324,7 @@ namespace Microsoft.PowerShell.ScheduledJob
|
||||
/// - Enabled state
|
||||
/// </summary>
|
||||
/// <returns>Boolean if this object data is modified.</returns>
|
||||
private bool UpdateDefintionFromWTS()
|
||||
private bool UpdateDefinitionFromWTS()
|
||||
{
|
||||
bool dataModified = false;
|
||||
|
||||
@@ -697,7 +697,7 @@ namespace Microsoft.PowerShell.ScheduledJob
|
||||
Exception notFoundEx = null;
|
||||
try
|
||||
{
|
||||
if (UpdateDefintionFromWTS())
|
||||
if (UpdateDefinitionFromWTS())
|
||||
{
|
||||
SaveToStore();
|
||||
}
|
||||
|
||||
+2
-2
@@ -208,8 +208,8 @@ namespace Microsoft.PowerShell.Workflow
|
||||
using (System.Management.Automation.PowerShell ps = System.Management.Automation.PowerShell.Create())
|
||||
{
|
||||
ps.Runspace = runspace;
|
||||
string langSript = "$ExecutionContext.SessionState.LanguageMode = '" + _languageMode.Value.ToString() + "'";
|
||||
ps.AddScript(langSript);
|
||||
string langScript = "$ExecutionContext.SessionState.LanguageMode = '" + _languageMode.Value.ToString() + "'";
|
||||
ps.AddScript(langScript);
|
||||
ps.Invoke();
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -1491,7 +1491,7 @@ namespace Microsoft.PowerShell.Workflow
|
||||
Connection newConnection = CreateConnection(requestInfo, connections);
|
||||
_perfCountersMgr.UpdateCounterByValue(
|
||||
PSWorkflowPerformanceCounterSetInfo.CounterSetId,
|
||||
PSWorkflowPerformanceCounterIds.PSRemotingConnectionsClosedReopendCount);
|
||||
PSWorkflowPerformanceCounterIds.PSRemotingConnectionsClosedReopenedCount);
|
||||
SubmitOperation(new CloseOneAndOpenAnotherOperation(potentialConnection, newConnection));
|
||||
_perfCountersMgr.UpdateCounterByValue(
|
||||
PSWorkflowPerformanceCounterSetInfo.CounterSetId,
|
||||
|
||||
+3
-3
@@ -22,7 +22,7 @@ namespace Microsoft.PowerShell.Workflow
|
||||
/// <summary>
|
||||
/// The additional entry for security 'POWERSHELLWORKFLOW'
|
||||
/// </summary>
|
||||
private static byte[] s_aditionalEntropy = { (byte)'P', (byte)'O', (byte)'W', (byte)'E', (byte)'R', (byte)'S', (byte)'H', (byte)'E', (byte)'L', (byte)'L', (byte)'W', (byte)'O', (byte)'R', (byte)'K', (byte)'F', (byte)'L', (byte)'O', (byte)'W' };
|
||||
private static byte[] s_additionalEntropy = { (byte)'P', (byte)'O', (byte)'W', (byte)'E', (byte)'R', (byte)'S', (byte)'H', (byte)'E', (byte)'L', (byte)'L', (byte)'W', (byte)'O', (byte)'R', (byte)'K', (byte)'F', (byte)'L', (byte)'O', (byte)'W' };
|
||||
|
||||
/// <summary>
|
||||
/// Protect the data.
|
||||
@@ -35,7 +35,7 @@ namespace Microsoft.PowerShell.Workflow
|
||||
{
|
||||
// Encrypt the data using DataProtectionScope.CurrentUser. The result can be decrypted
|
||||
// only by the same current user.
|
||||
return ProtectedData.Protect(data, s_aditionalEntropy, DataProtectionScope.CurrentUser);
|
||||
return ProtectedData.Protect(data, s_additionalEntropy, DataProtectionScope.CurrentUser);
|
||||
}
|
||||
catch (CryptographicException e)
|
||||
{
|
||||
@@ -54,7 +54,7 @@ namespace Microsoft.PowerShell.Workflow
|
||||
{
|
||||
try
|
||||
{
|
||||
return ProtectedData.Unprotect(data, s_aditionalEntropy, DataProtectionScope.CurrentUser);
|
||||
return ProtectedData.Unprotect(data, s_additionalEntropy, DataProtectionScope.CurrentUser);
|
||||
}
|
||||
catch (CryptographicException e)
|
||||
{
|
||||
|
||||
+4
-4
@@ -19,19 +19,19 @@ namespace Microsoft.PowerShell.Workflow
|
||||
internal static void SetDirectoryPermissions(string folderName)
|
||||
{
|
||||
string account = WindowsIdentity.GetCurrent().Name;
|
||||
RemoveInheritablePermissons(folderName);
|
||||
RemoveInheritablePermissions(folderName);
|
||||
AddDirectorySecurity(folderName, account, FileSystemRights.Modify, InheritanceFlags.ContainerInherit | InheritanceFlags.ObjectInherit, PropagationFlags.None, AccessControlType.Allow);
|
||||
}
|
||||
|
||||
private static void AddDirectorySecurity(string folderName, string account, FileSystemRights rights, InheritanceFlags inheritance, PropagationFlags propogation, AccessControlType controlType)
|
||||
private static void AddDirectorySecurity(string folderName, string account, FileSystemRights rights, InheritanceFlags inheritance, PropagationFlags propagation, AccessControlType controlType)
|
||||
{
|
||||
DirectoryInfo info = new DirectoryInfo(folderName);
|
||||
DirectorySecurity dSecurity = info.GetAccessControl();
|
||||
dSecurity.AddAccessRule(new FileSystemAccessRule(account, rights, inheritance, propogation, controlType));
|
||||
dSecurity.AddAccessRule(new FileSystemAccessRule(account, rights, inheritance, propagation, controlType));
|
||||
info.SetAccessControl(dSecurity);
|
||||
}
|
||||
|
||||
private static void RemoveInheritablePermissons(string folderName)
|
||||
private static void RemoveInheritablePermissions(string folderName)
|
||||
{
|
||||
DirectoryInfo info = new DirectoryInfo(folderName);
|
||||
DirectorySecurity dSecurity = info.GetAccessControl();
|
||||
|
||||
+3
-3
@@ -3121,13 +3121,13 @@ namespace Microsoft.PowerShell.Activities
|
||||
}
|
||||
else
|
||||
{
|
||||
PSOutOfProcessActivityController delgateController = workflowHost.PSActivityHostController as PSOutOfProcessActivityController;
|
||||
if (delgateController != null)
|
||||
PSOutOfProcessActivityController delegateController = workflowHost.PSActivityHostController as PSOutOfProcessActivityController;
|
||||
if (delegateController != null)
|
||||
{
|
||||
AddHandlersToStreams(commandToRun, args);
|
||||
|
||||
IAsyncResult asyncResult =
|
||||
delgateController.BeginInvokePowerShell(commandToRun, input,
|
||||
delegateController.BeginInvokePowerShell(commandToRun, input,
|
||||
output,
|
||||
implementationContext.PSActivityEnvironment,
|
||||
ActivityHostManagerCallback,
|
||||
|
||||
+1
-1
@@ -593,7 +593,7 @@ namespace Microsoft.PowerShell.Workflow
|
||||
/// <summary>
|
||||
/// On suspended handler.
|
||||
/// </summary>
|
||||
internal Action<object> OnSuspenedDelegate
|
||||
internal Action<object> OnSuspendedDelegate
|
||||
{
|
||||
set { this.OnSuspended = value; }
|
||||
}
|
||||
|
||||
+1
-1
@@ -998,7 +998,7 @@ namespace Microsoft.PowerShell.Workflow
|
||||
debugSource = new DebugSource(
|
||||
debugSource.Script, // Update script
|
||||
debugSource.ScriptFile, // Update script filename
|
||||
existingInfo.XamlDefinition); // Keep XamlDefintion
|
||||
existingInfo.XamlDefinition); // Keep XamlDefinition
|
||||
}
|
||||
|
||||
funcToSourceMap.Add(fName, debugSource);
|
||||
|
||||
+12
-12
@@ -234,13 +234,13 @@ namespace Microsoft.PowerShell.Workflow
|
||||
|
||||
lock (_syncObject)
|
||||
{
|
||||
Dictionary<int, Tuple<object, string>> ruspaceIdCollection;
|
||||
if (_remoteRunspaceIdCollection.TryGetValue(activityId, out ruspaceIdCollection))
|
||||
Dictionary<int, Tuple<object, string>> runspaceIdCollection;
|
||||
if (_remoteRunspaceIdCollection.TryGetValue(activityId, out runspaceIdCollection))
|
||||
{
|
||||
if (ruspaceIdCollection != null)
|
||||
if (runspaceIdCollection != null)
|
||||
{
|
||||
Tuple<object, string> taskTuple;
|
||||
ruspaceIdCollection.TryGetValue(taskId, out taskTuple);
|
||||
runspaceIdCollection.TryGetValue(taskId, out taskTuple);
|
||||
|
||||
if (taskTuple != null)
|
||||
taskRunspaceId = taskTuple.Item1;
|
||||
@@ -2009,22 +2009,22 @@ namespace Microsoft.PowerShell.Workflow
|
||||
this.workflowApplication.Extensions.Add(this.GetTrackingParticipant());
|
||||
|
||||
// adding the custom extensions
|
||||
IEnumerable<object> extentions = this.Runtime.Configuration.CreateWorkflowExtensions();
|
||||
if (extentions != null)
|
||||
IEnumerable<object> extensions = this.Runtime.Configuration.CreateWorkflowExtensions();
|
||||
if (extensions != null)
|
||||
{
|
||||
foreach (object extention in extentions)
|
||||
foreach (object extension in extensions)
|
||||
{
|
||||
this.workflowApplication.Extensions.Add(extention);
|
||||
this.workflowApplication.Extensions.Add(extension);
|
||||
}
|
||||
}
|
||||
|
||||
// adding the custom extension creation functions
|
||||
IEnumerable<Func<object>> extentionFunctions = this.Runtime.Configuration.CreateWorkflowExtensionCreationFunctions<object>();
|
||||
if (extentionFunctions != null)
|
||||
IEnumerable<Func<object>> extensionFunctions = this.Runtime.Configuration.CreateWorkflowExtensionCreationFunctions<object>();
|
||||
if (extensionFunctions != null)
|
||||
{
|
||||
foreach(Func<object> extentionFunc in extentionFunctions)
|
||||
foreach(Func<object> extensionFunc in extensionFunctions)
|
||||
{
|
||||
this.workflowApplication.Extensions.Add<object>(extentionFunc);
|
||||
this.workflowApplication.Extensions.Add<object>(extensionFunc);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -1327,7 +1327,7 @@ namespace Microsoft.PowerShell.Workflow
|
||||
internal void ConfigureWorkflowHandlers()
|
||||
{
|
||||
_workflowInstance.OnCompletedDelegate = OnWorkflowCompleted;
|
||||
_workflowInstance.OnSuspenedDelegate = OnWorkflowSuspended;
|
||||
_workflowInstance.OnSuspendedDelegate = OnWorkflowSuspended;
|
||||
_workflowInstance.OnStoppedDelegate = OnWorkflowStopped;
|
||||
_workflowInstance.OnAbortedDelegate = OnWorkflowAborted;
|
||||
_workflowInstance.OnFaultedDelegate = OnWorkflowFaulted;
|
||||
|
||||
+3
-3
@@ -166,15 +166,15 @@ namespace Microsoft.PowerShell.Workflow
|
||||
{
|
||||
foreach (PSWorkflowJob job in newJob.ChildJobs)
|
||||
{
|
||||
bool? psPersitValue = null;
|
||||
bool? psPersistValue = null;
|
||||
PSWorkflowContext context = job.PSWorkflowInstance.PSWorkflowContext;
|
||||
if (context != null && context.PSWorkflowCommonParameters != null && context.PSWorkflowCommonParameters.ContainsKey(Constants.Persist))
|
||||
{
|
||||
psPersitValue = context.PSWorkflowCommonParameters[Constants.Persist] as bool?;
|
||||
psPersistValue = context.PSWorkflowCommonParameters[Constants.Persist] as bool?;
|
||||
}
|
||||
|
||||
// check for invocation time pspersist value if not true then there is a possibility that workflow is not suspendable.
|
||||
if (psPersitValue == null || (psPersitValue == false))
|
||||
if (psPersistValue == null || (psPersistValue == false))
|
||||
{
|
||||
// check for authoring time definition of persist activity
|
||||
if (isSuspendable != null && isSuspendable.Value == false)
|
||||
|
||||
+2
-2
@@ -1392,8 +1392,8 @@ namespace Microsoft.PowerShell.Workflow
|
||||
{
|
||||
if (Thread.CurrentThread.GetApartmentState() == ApartmentState.STA)
|
||||
{
|
||||
foreach (WaitHandle hanlde in waitHandles)
|
||||
hanlde.WaitOne();
|
||||
foreach (WaitHandle handle in waitHandles)
|
||||
handle.WaitOne();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
+2
-2
@@ -56,7 +56,7 @@ namespace Microsoft.PowerShell.Workflow
|
||||
new CounterInfo(PSWorkflowPerformanceCounterIds.PSRemotingForcedToWaitRequestsQueueLength, CounterType.RawData64),
|
||||
new CounterInfo(PSWorkflowPerformanceCounterIds.PSRemotingConnectionsCreatedCount, CounterType.RawData64),
|
||||
new CounterInfo(PSWorkflowPerformanceCounterIds.PSRemotingConnectionsDisposedCount, CounterType.RawData64),
|
||||
new CounterInfo(PSWorkflowPerformanceCounterIds.PSRemotingConnectionsClosedReopendCount, CounterType.RawData64)
|
||||
new CounterInfo(PSWorkflowPerformanceCounterIds.PSRemotingConnectionsClosedReopenedCount, CounterType.RawData64)
|
||||
};
|
||||
}
|
||||
|
||||
@@ -100,7 +100,7 @@ namespace Microsoft.PowerShell.Workflow
|
||||
internal const int PSRemotingForcedToWaitRequestsQueueLength = PSRemotingRequestsBeingServicedCount + 1;
|
||||
internal const int PSRemotingConnectionsCreatedCount = PSRemotingForcedToWaitRequestsQueueLength + 1;
|
||||
internal const int PSRemotingConnectionsDisposedCount = PSRemotingConnectionsCreatedCount + 1;
|
||||
internal const int PSRemotingConnectionsClosedReopendCount = PSRemotingConnectionsDisposedCount + 1;
|
||||
internal const int PSRemotingConnectionsClosedReopenedCount = PSRemotingConnectionsDisposedCount + 1;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ namespace Microsoft.WSMan.Management
|
||||
/// <summary>
|
||||
/// Object contains the cache of the enumerate results for the cmdlet to execute.
|
||||
/// </summary>
|
||||
Dictionary<string, XmlDocument> enumarateMapping = new Dictionary<string, XmlDocument>();
|
||||
Dictionary<string, XmlDocument> enumerateMapping = new Dictionary<string, XmlDocument>();
|
||||
|
||||
/// <summary>
|
||||
/// Mapping of ResourceURI with the XML returned by the Get call.
|
||||
@@ -406,7 +406,7 @@ namespace Microsoft.WSMan.Management
|
||||
if (xmlListeners != null)
|
||||
{
|
||||
Hashtable KeyCache, ListenerObjCache;
|
||||
ProcessListernerObjects(xmlListeners, out ListenerObjCache, out KeyCache);
|
||||
ProcessListenerObjects(xmlListeners, out ListenerObjCache, out KeyCache);
|
||||
if (ListenerObjCache.Count > 0)
|
||||
{
|
||||
return true;
|
||||
@@ -1448,7 +1448,7 @@ namespace Microsoft.WSMan.Management
|
||||
if (xmlListeners != null)
|
||||
{
|
||||
Hashtable KeyCache, ListenerObjCache;
|
||||
ProcessListernerObjects(xmlListeners, out ListenerObjCache, out KeyCache);
|
||||
ProcessListenerObjects(xmlListeners, out ListenerObjCache, out KeyCache);
|
||||
if (KeyCache.Contains(childname))
|
||||
{
|
||||
return true;
|
||||
@@ -1962,7 +1962,7 @@ namespace Microsoft.WSMan.Management
|
||||
}
|
||||
else if (ContainerListenerOrCertMapping.Equals(WSManStringLiterals.containerListener))
|
||||
{
|
||||
ProcessListernerObjects(xmlResource, out CCache, out kCache);
|
||||
ProcessListenerObjects(xmlResource, out CCache, out kCache);
|
||||
}
|
||||
if (CCache != null && CCache.Count > 0)
|
||||
{
|
||||
@@ -2292,7 +2292,7 @@ namespace Microsoft.WSMan.Management
|
||||
|
||||
if (ResourceURI.EndsWith(WSManStringLiterals.containerListener, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
ProcessListernerObjects(xmlResource, out objcache, out Keyscache);
|
||||
ProcessListenerObjects(xmlResource, out objcache, out Keyscache);
|
||||
}
|
||||
else if (ResourceURI.EndsWith(WSManStringLiterals.containerCertMapping, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
@@ -2677,7 +2677,7 @@ namespace Microsoft.WSMan.Management
|
||||
{
|
||||
XmlDocument xmlEnumResources = null;
|
||||
|
||||
if (!this.enumarateMapping.TryGetValue(ResourceURI, out xmlEnumResources))
|
||||
if (!this.enumerateMapping.TryGetValue(ResourceURI, out xmlEnumResources))
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -2696,7 +2696,7 @@ namespace Microsoft.WSMan.Management
|
||||
xmlEnumResources = new XmlDocument();
|
||||
strXmlValue = "<WsManResults>" + strXmlValue + "</WsManResults>";
|
||||
xmlEnumResources.LoadXml(strXmlValue);
|
||||
this.enumarateMapping.Add(ResourceURI, xmlEnumResources);
|
||||
this.enumerateMapping.Add(ResourceURI, xmlEnumResources);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -3604,7 +3604,7 @@ namespace Microsoft.WSMan.Management
|
||||
}
|
||||
else if (ListenerOrCerMapping.Equals(WSManStringLiterals.containerListener))
|
||||
{
|
||||
ProcessListernerObjects(xmlResource, out Objcache, out Keyscache);
|
||||
ProcessListenerObjects(xmlResource, out Objcache, out Keyscache);
|
||||
}
|
||||
else
|
||||
{ return; }
|
||||
@@ -3665,7 +3665,7 @@ namespace Microsoft.WSMan.Management
|
||||
Hashtable Objcache, Keyscache;
|
||||
if (ContainerListenerOrClientCert.Equals(WSManStringLiterals.containerListener, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
ProcessListernerObjects(xmlResource, out Objcache, out Keyscache);
|
||||
ProcessListenerObjects(xmlResource, out Objcache, out Keyscache);
|
||||
}
|
||||
else if (ContainerListenerOrClientCert.Equals(WSManStringLiterals.containerClientCertificate, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
@@ -3715,7 +3715,7 @@ namespace Microsoft.WSMan.Management
|
||||
}
|
||||
else
|
||||
{
|
||||
ProcessListernerObjects(xmlresources, out ResourcesCache, out KeysCache);
|
||||
ProcessListenerObjects(xmlresources, out ResourcesCache, out KeysCache);
|
||||
}
|
||||
if (KeysCache.Contains(childname))
|
||||
{
|
||||
@@ -3950,7 +3950,7 @@ namespace Microsoft.WSMan.Management
|
||||
}
|
||||
else
|
||||
{
|
||||
ProcessListernerObjects(outxml, out objcache, out KeysCache);
|
||||
ProcessListenerObjects(outxml, out objcache, out KeysCache);
|
||||
}
|
||||
|
||||
String PathChecked = host + WSManStringLiterals.DefaultPathSeparator + parentListenerOrCert;
|
||||
@@ -4644,7 +4644,7 @@ namespace Microsoft.WSMan.Management
|
||||
Keyscache = kCache;
|
||||
}
|
||||
|
||||
private void ProcessListernerObjects(XmlDocument xmlListeners, out Hashtable listenercache, out Hashtable Keyscache)
|
||||
private void ProcessListenerObjects(XmlDocument xmlListeners, out Hashtable listenercache, out Hashtable Keyscache)
|
||||
{
|
||||
Hashtable lCache = new Hashtable();
|
||||
Hashtable kCache = new Hashtable();
|
||||
@@ -4871,11 +4871,11 @@ namespace Microsoft.WSMan.Management
|
||||
// ArrayList SecurityLvl = null;
|
||||
if (xmlSecurity != null)
|
||||
{
|
||||
XmlNodeList nodelistSecutiry = xmlSecurity.GetElementsByTagName(WSManStringLiterals.containerSecurity);
|
||||
if (nodelistSecutiry.Count > 0)
|
||||
XmlNodeList nodelistSecurity = xmlSecurity.GetElementsByTagName(WSManStringLiterals.containerSecurity);
|
||||
if (nodelistSecurity.Count > 0)
|
||||
{
|
||||
//SecurityLvl = new ArrayList();
|
||||
foreach (XmlElement xe in nodelistSecutiry)
|
||||
foreach (XmlElement xe in nodelistSecurity)
|
||||
{
|
||||
bool ExactMatchFound = false;
|
||||
PSObject objSecurity = new PSObject();
|
||||
|
||||
@@ -440,7 +440,7 @@ namespace Microsoft.WSMan.Management
|
||||
|
||||
//private const string DelegateComputerParam = "DelegateComputer";
|
||||
//private String[] delegatecomputer;
|
||||
//private RuntimeDefinedParameterDictionary dyanmicParameters = new RuntimeDefinedParameterDictionary();
|
||||
//private RuntimeDefinedParameterDictionary dynamicParameters = new RuntimeDefinedParameterDictionary();
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -544,7 +544,7 @@ namespace Microsoft.WSMan.Management
|
||||
// return null if the role is not client.
|
||||
if (!Role.Equals(ClientRole, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return dyanmicParameters;
|
||||
return dynamicParameters;
|
||||
}
|
||||
|
||||
// Construct attributes for the DelegateComputer parameter
|
||||
@@ -561,9 +561,9 @@ namespace Microsoft.WSMan.Management
|
||||
DelegateComputerParam,
|
||||
typeof(string[]),
|
||||
delegateComputerAttributeCollection);
|
||||
dyanmicParameters.Add(DelegateComputerParam, delegateComputer);
|
||||
dynamicParameters.Add(DelegateComputerParam, delegateComputer);
|
||||
|
||||
return dyanmicParameters;
|
||||
return dynamicParameters;
|
||||
|
||||
} // GetDynamicParameters*/
|
||||
|
||||
@@ -603,7 +603,7 @@ namespace Microsoft.WSMan.Management
|
||||
return;
|
||||
}
|
||||
// Extract delegateComputer information from dynamic parameters collection
|
||||
//RuntimeDefinedParameter delegateComputerParameter = dyanmicParameters[DelegateComputerParam];
|
||||
//RuntimeDefinedParameter delegateComputerParameter = dynamicParameters[DelegateComputerParam];
|
||||
//delegatecomputer = (string[])delegateComputerParameter.Value;
|
||||
|
||||
string newxmlcontent = @"<cfg:Auth xmlns:cfg=""http://schemas.microsoft.com/wbem/wsman/1/config/client/auth""><cfg:CredSSP>true</cfg:CredSSP></cfg:Auth>";
|
||||
|
||||
@@ -41,14 +41,14 @@ namespace Microsoft.WSMan.Management
|
||||
{
|
||||
get
|
||||
{
|
||||
return _proxyacesstype;
|
||||
return _proxyaccesstype;
|
||||
}
|
||||
set
|
||||
{
|
||||
_proxyacesstype = value;
|
||||
_proxyaccesstype = value;
|
||||
}
|
||||
}
|
||||
private ProxyAccessType _proxyacesstype;
|
||||
private ProxyAccessType _proxyaccesstype;
|
||||
|
||||
/// <summary>
|
||||
/// The following is the definition of the input parameter "ProxyAuthentication".
|
||||
@@ -253,7 +253,7 @@ namespace Microsoft.WSMan.Management
|
||||
objSessionOption.OperationTimeout = operationtimeout;
|
||||
objSessionOption.SkipRevocationCheck = skiprevocationcheck;
|
||||
//Proxy Settings
|
||||
objSessionOption.ProxyAccessType = _proxyacesstype;
|
||||
objSessionOption.ProxyAccessType = _proxyaccesstype;
|
||||
objSessionOption.ProxyAuthentication = proxyauthentication;
|
||||
|
||||
if (noencryption)
|
||||
|
||||
@@ -420,10 +420,10 @@ namespace System.Management.Automation
|
||||
do
|
||||
{
|
||||
// Use 'for' loop to avoid construct new ArrayEnumerator object
|
||||
for (int constorIndex = 0; constorIndex < constructors.Length; constorIndex++)
|
||||
for (int constructorIndex = 0; constructorIndex < constructors.Length; constructorIndex++)
|
||||
{
|
||||
var constor = constructors[constorIndex];
|
||||
ParameterInfo[] parameters = constor.GetParameters();
|
||||
var constructor = constructors[constructorIndex];
|
||||
ParameterInfo[] parameters = constructor.GetParameters();
|
||||
if (types.Length == parameters.Length)
|
||||
{
|
||||
bool success = true;
|
||||
@@ -438,7 +438,7 @@ namespace System.Management.Automation
|
||||
|
||||
if (success)
|
||||
{
|
||||
matchConstructors.Add(constor);
|
||||
matchConstructors.Add(constructor);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1110,7 +1110,7 @@ namespace System.Management.Automation
|
||||
break;
|
||||
case SpecialFolder.LocalApplicationData:
|
||||
folderPath = System.Environment.GetEnvironmentVariable("LOCALAPPDATA");
|
||||
// When powershell gets executed in SetupComplete.cmd during NanoSrever's first boot, 'LOCALAPPDATA' won't be set yet.
|
||||
// When powershell gets executed in SetupComplete.cmd during NanoServer's first boot, 'LOCALAPPDATA' won't be set yet.
|
||||
// In this case, we need to return an alternate path, so that module auto-loading can continue to work properly.
|
||||
if (folderPath == null)
|
||||
{
|
||||
|
||||
@@ -1275,7 +1275,7 @@ namespace Microsoft.PowerShell.DesiredStateConfiguration.Internal
|
||||
// And now define the driver functions in the current scope...
|
||||
if (functionsToDefine != null)
|
||||
{
|
||||
functionsToDefine[moduleName + "\\" + keyword.Keyword] = CimKeywordImlementationFunction;
|
||||
functionsToDefine[moduleName + "\\" + keyword.Keyword] = CimKeywordImplementationFunction;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3583,17 +3583,17 @@ namespace Microsoft.PowerShell.DesiredStateConfiguration.Internal
|
||||
/// <summary>
|
||||
/// The scriptblock that implements the CIM keyword functionality.
|
||||
/// </summary>
|
||||
private static ScriptBlock CimKeywordImlementationFunction
|
||||
private static ScriptBlock CimKeywordImplementationFunction
|
||||
{
|
||||
get
|
||||
{
|
||||
// The scriptblock cache will handle mutual exclusion
|
||||
return s_cimKeywordImlementationFunction ??
|
||||
(s_cimKeywordImlementationFunction = ScriptBlock.Create(CimKeywordImlementationFunctionText));
|
||||
return s_cimKeywordImplementationFunction ??
|
||||
(s_cimKeywordImplementationFunction = ScriptBlock.Create(CimKeywordImplementationFunctionText));
|
||||
}
|
||||
}
|
||||
private static ScriptBlock s_cimKeywordImlementationFunction;
|
||||
private const string CimKeywordImlementationFunctionText = @"
|
||||
private static ScriptBlock s_cimKeywordImplementationFunction;
|
||||
private const string CimKeywordImplementationFunctionText = @"
|
||||
param (
|
||||
[Parameter(Mandatory)]
|
||||
$KeywordData,
|
||||
|
||||
+5
-5
@@ -154,7 +154,7 @@ namespace Microsoft.PowerShell.Commands.Internal.Format
|
||||
hash.Add (FormatParameterDefinitionKeys.WidthEntryKey, width);
|
||||
|
||||
if (align != null)
|
||||
hash.Add (FormatParameterDefinitionKeys.AligmentEntryKey, align);
|
||||
hash.Add (FormatParameterDefinitionKeys.AlignmentEntryKey, align);
|
||||
|
||||
return hash;
|
||||
}
|
||||
@@ -244,9 +244,9 @@ namespace Microsoft.PowerShell.Commands.Internal.Format
|
||||
private bool _noGlobbing;
|
||||
}
|
||||
|
||||
internal class AligmentEntryDefinition : HashtableEntryDefinition
|
||||
internal class AlignmentEntryDefinition : HashtableEntryDefinition
|
||||
{
|
||||
internal AligmentEntryDefinition() : base(FormatParameterDefinitionKeys.AligmentEntryKey,
|
||||
internal AlignmentEntryDefinition() : base(FormatParameterDefinitionKeys.AlignmentEntryKey,
|
||||
new Type[] { typeof(string) })
|
||||
{
|
||||
}
|
||||
@@ -414,7 +414,7 @@ namespace Microsoft.PowerShell.Commands.Internal.Format
|
||||
internal const string FormatStringEntryKey = "formatString";
|
||||
|
||||
// specific to format-table
|
||||
internal const string AligmentEntryKey = "alignment";
|
||||
internal const string AlignmentEntryKey = "alignment";
|
||||
internal const string WidthEntryKey = "width";
|
||||
|
||||
// specific to format-table,list and wide
|
||||
@@ -453,7 +453,7 @@ namespace Microsoft.PowerShell.Commands.Internal.Format
|
||||
{
|
||||
base.SetEntries();
|
||||
this.hashEntries.Add(new WidthEntryDefinition());
|
||||
this.hashEntries.Add(new AligmentEntryDefinition());
|
||||
this.hashEntries.Add(new AlignmentEntryDefinition());
|
||||
this.hashEntries.Add(new LabelEntryDefinition());
|
||||
}
|
||||
}
|
||||
|
||||
+4
-4
@@ -920,7 +920,7 @@ namespace Microsoft.PowerShell.Commands.Internal.Format
|
||||
columnWidthsHint = tableHint.columnWidths;
|
||||
}
|
||||
|
||||
int columsOnTheScreen = this.InnerCommand._lo.ColumnNumber;
|
||||
int columnsOnTheScreen = this.InnerCommand._lo.ColumnNumber;
|
||||
|
||||
int columns = this.CurrentTableHeaderInfo.tableColumnInfoList.Count;
|
||||
if (columns == 0)
|
||||
@@ -939,7 +939,7 @@ namespace Microsoft.PowerShell.Commands.Internal.Format
|
||||
alignment[k] = tci.alignment;
|
||||
k++;
|
||||
}
|
||||
this.Writer.Initialize(0, columsOnTheScreen, columnWidths, alignment, this.CurrentTableHeaderInfo.hideHeader);
|
||||
this.Writer.Initialize(0, columnsOnTheScreen, columnWidths, alignment, this.CurrentTableHeaderInfo.hideHeader);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -1200,7 +1200,7 @@ namespace Microsoft.PowerShell.Commands.Internal.Format
|
||||
return;
|
||||
}
|
||||
|
||||
string[] values = new string[_buffer.Lenght];
|
||||
string[] values = new string[_buffer.Length];
|
||||
for (int k = 0; k < values.Length; k++)
|
||||
{
|
||||
if (k < _buffer.CurrentCount)
|
||||
@@ -1231,7 +1231,7 @@ namespace Microsoft.PowerShell.Commands.Internal.Format
|
||||
/// <summary>
|
||||
/// get the size of the buffer
|
||||
/// </summary>
|
||||
internal int Lenght { get { return _arr.Length; } }
|
||||
internal int Length { get { return _arr.Length; } }
|
||||
|
||||
/// <summary>
|
||||
/// get the current number of entries in the buffer
|
||||
|
||||
+6
-6
@@ -349,8 +349,8 @@ namespace Microsoft.PowerShell.Commands.Internal.Format
|
||||
if (Database == null)
|
||||
{
|
||||
TypeInfoDataBase tempDataBase = new TypeInfoDataBase();
|
||||
AddPreLoadInstrinsics(tempDataBase);
|
||||
AddPostLoadInstrinsics(tempDataBase);
|
||||
AddPreLoadIntrinsics(tempDataBase);
|
||||
AddPostLoadIntrinsics(tempDataBase);
|
||||
Database = tempDataBase;
|
||||
}
|
||||
}
|
||||
@@ -393,7 +393,7 @@ namespace Microsoft.PowerShell.Commands.Internal.Format
|
||||
TypeInfoDataBase db = new TypeInfoDataBase();
|
||||
|
||||
// prepopulate the database with any necessary overriding data
|
||||
AddPreLoadInstrinsics(db);
|
||||
AddPreLoadIntrinsics(db);
|
||||
|
||||
var etwEnabled = RunspaceEventSource.Log.IsEnabled();
|
||||
|
||||
@@ -439,7 +439,7 @@ namespace Microsoft.PowerShell.Commands.Internal.Format
|
||||
}
|
||||
|
||||
// add any sensible defaults to the database
|
||||
AddPostLoadInstrinsics(db);
|
||||
AddPostLoadIntrinsics(db);
|
||||
|
||||
return db;
|
||||
}
|
||||
@@ -534,7 +534,7 @@ namespace Microsoft.PowerShell.Commands.Internal.Format
|
||||
/// helper to to add any pre-load intrinsics to the db
|
||||
/// </summary>
|
||||
/// <param name="db">db being initialized</param>
|
||||
private static void AddPreLoadInstrinsics(TypeInfoDataBase db)
|
||||
private static void AddPreLoadIntrinsics(TypeInfoDataBase db)
|
||||
{
|
||||
// NOTE: nothing to add for the time being. Add here if needed.
|
||||
}
|
||||
@@ -543,7 +543,7 @@ namespace Microsoft.PowerShell.Commands.Internal.Format
|
||||
/// helper to to add any post-load intrinsics to the db
|
||||
/// </summary>
|
||||
/// <param name="db">db being initialized</param>
|
||||
private static void AddPostLoadInstrinsics(TypeInfoDataBase db)
|
||||
private static void AddPostLoadIntrinsics(TypeInfoDataBase db)
|
||||
{
|
||||
// add entry for the output of update-formatdata
|
||||
// we want to be able to display this as a list, unless overridden
|
||||
|
||||
+3
-3
@@ -158,9 +158,9 @@ namespace Microsoft.PowerShell.Commands.Internal.Format
|
||||
internal const string True = "TRUE";
|
||||
internal const string False = "FALSE";
|
||||
|
||||
internal const string AligmentLeft = "left";
|
||||
internal const string AligmentCenter = "center";
|
||||
internal const string AligmentRight = "right";
|
||||
internal const string AlignmentLeft = "left";
|
||||
internal const string AlignmentCenter = "center";
|
||||
internal const string AlignmentRight = "right";
|
||||
}
|
||||
|
||||
// Flag that determines whether validation should be suppressed while
|
||||
|
||||
+3
-3
@@ -270,15 +270,15 @@ namespace Microsoft.PowerShell.Commands.Internal.Format
|
||||
return false; // fatal error
|
||||
}
|
||||
|
||||
if (string.Equals(n.InnerText, XMLStringValues.AligmentLeft, StringComparison.OrdinalIgnoreCase))
|
||||
if (string.Equals(n.InnerText, XMLStringValues.AlignmentLeft, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
alignmentValue = TextAlignment.Left;
|
||||
}
|
||||
else if (string.Equals(n.InnerText, XMLStringValues.AligmentRight, StringComparison.OrdinalIgnoreCase))
|
||||
else if (string.Equals(n.InnerText, XMLStringValues.AlignmentRight, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
alignmentValue = TextAlignment.Right;
|
||||
}
|
||||
else if (string.Equals(n.InnerText, XMLStringValues.AligmentCenter, StringComparison.OrdinalIgnoreCase))
|
||||
else if (string.Equals(n.InnerText, XMLStringValues.AlignmentCenter, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
alignmentValue = TextAlignment.Center;
|
||||
}
|
||||
|
||||
+1
-1
@@ -255,7 +255,7 @@ namespace Microsoft.PowerShell.Commands.Internal.Format
|
||||
// set the alignment
|
||||
if (a.OriginatingParameter != null)
|
||||
{
|
||||
object key = a.OriginatingParameter.GetEntry(FormatParameterDefinitionKeys.AligmentEntryKey);
|
||||
object key = a.OriginatingParameter.GetEntry(FormatParameterDefinitionKeys.AlignmentEntryKey);
|
||||
|
||||
if (key != AutomationNull.Value)
|
||||
ci.alignment = (int)key;
|
||||
|
||||
+2
-2
@@ -308,7 +308,7 @@ namespace Microsoft.PowerShell.Commands.Internal.Format
|
||||
return rows;
|
||||
}
|
||||
|
||||
private StringCollection GenerateMultiLineRowField(string val, int k, int aligment, DisplayCells dc)
|
||||
private StringCollection GenerateMultiLineRowField(string val, int k, int alignment, DisplayCells dc)
|
||||
{
|
||||
StringCollection sc = StringManipulationHelper.GenerateLines(dc, val,
|
||||
_si.columnInfo[k].width, _si.columnInfo[k].width);
|
||||
@@ -316,7 +316,7 @@ namespace Microsoft.PowerShell.Commands.Internal.Format
|
||||
for (int col = 0; col < sc.Count; col++)
|
||||
{
|
||||
if (dc.Length(sc[col]) < _si.columnInfo[k].width)
|
||||
sc[col] = GenerateRowField(sc[col], _si.columnInfo[k].width, aligment, dc);
|
||||
sc[col] = GenerateRowField(sc[col], _si.columnInfo[k].width, alignment, dc);
|
||||
}
|
||||
return sc;
|
||||
}
|
||||
|
||||
@@ -2056,7 +2056,7 @@ namespace System.Management.Automation
|
||||
if (_currentParameterSetFlag == defaultParameterSet)
|
||||
Command.SetParameterSetName(CurrentParameterSetName);
|
||||
else
|
||||
_parameterSetToBePrioritizedInPipelingBinding = defaultParameterSet;
|
||||
_parameterSetToBePrioritizedInPipelineBinding = defaultParameterSet;
|
||||
}
|
||||
}
|
||||
// We need to analyze the prompting data that was gathered to determine what parameter
|
||||
@@ -2082,7 +2082,7 @@ namespace System.Management.Automation
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (_parameterSetToBePrioritizedInPipelingBinding == 0)
|
||||
else if (_parameterSetToBePrioritizedInPipelineBinding == 0)
|
||||
{
|
||||
// We have more than one valid parameter set. Need to figure out which one to
|
||||
// use.
|
||||
@@ -2573,7 +2573,7 @@ namespace System.Management.Automation
|
||||
|
||||
if (_currentParameterSetFlag != chosenMandatorySet)
|
||||
{
|
||||
_parameterSetToBePrioritizedInPipelingBinding = chosenMandatorySet;
|
||||
_parameterSetToBePrioritizedInPipelineBinding = chosenMandatorySet;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3459,15 +3459,15 @@ namespace System.Management.Automation
|
||||
|
||||
_currentParameterSetFlag = _prePipelineProcessingParameterSetFlags;
|
||||
uint validParameterSets = _currentParameterSetFlag;
|
||||
bool needToPrioritizeOneSpecificParameterSet = _parameterSetToBePrioritizedInPipelingBinding != 0;
|
||||
bool needToPrioritizeOneSpecificParameterSet = _parameterSetToBePrioritizedInPipelineBinding != 0;
|
||||
int steps = needToPrioritizeOneSpecificParameterSet ? 2 : 1;
|
||||
|
||||
if (needToPrioritizeOneSpecificParameterSet)
|
||||
{
|
||||
// _parameterSetToBePrioritizedInPipelingBinding is set, so we are certain that the specified parameter set must be valid,
|
||||
// _parameterSetToBePrioritizedInPipelineBinding is set, so we are certain that the specified parameter set must be valid,
|
||||
// and it's not the only valid parameter set.
|
||||
Diagnostics.Assert((_currentParameterSetFlag & _parameterSetToBePrioritizedInPipelingBinding) != 0, "_parameterSetToBePrioritizedInPipelingBinding should be valid if it's set");
|
||||
validParameterSets = _parameterSetToBePrioritizedInPipelingBinding;
|
||||
Diagnostics.Assert((_currentParameterSetFlag & _parameterSetToBePrioritizedInPipelineBinding) != 0, "_parameterSetToBePrioritizedInPipelineBinding should be valid if it's set");
|
||||
validParameterSets = _parameterSetToBePrioritizedInPipelineBinding;
|
||||
}
|
||||
|
||||
for (int i = 0; i < steps; i++)
|
||||
@@ -3501,8 +3501,8 @@ namespace System.Management.Automation
|
||||
if (needToPrioritizeOneSpecificParameterSet && i == 0)
|
||||
{
|
||||
// If the prioritized set can be bound successfully, there is no need to do the second round binding
|
||||
if (_currentParameterSetFlag == _parameterSetToBePrioritizedInPipelingBinding) break;
|
||||
validParameterSets = _currentParameterSetFlag & (~_parameterSetToBePrioritizedInPipelingBinding);
|
||||
if (_currentParameterSetFlag == _parameterSetToBePrioritizedInPipelineBinding) break;
|
||||
validParameterSets = _currentParameterSetFlag & (~_parameterSetToBePrioritizedInPipelineBinding);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4089,7 +4089,7 @@ namespace System.Management.Automation
|
||||
|
||||
#endregion DefaultParameterBindingStructures
|
||||
|
||||
private uint _parameterSetToBePrioritizedInPipelingBinding = 0;
|
||||
private uint _parameterSetToBePrioritizedInPipelineBinding = 0;
|
||||
|
||||
/// <summary>
|
||||
/// The cmdlet metadata.
|
||||
|
||||
@@ -18,11 +18,11 @@ namespace System.Management.Automation.ComInterop
|
||||
/// This class implements an event sink for a particular RCW.
|
||||
/// Unlike the implementation of events in TlbImp'd assemblies,
|
||||
/// we will create only one event sink per RCW (theoretically RCW might have
|
||||
/// several ComEventSink evenk sinks - but all these implement different source intefaces).
|
||||
/// several ComEventSink evenk sinks - but all these implement different source interfaces).
|
||||
/// Each ComEventSink contains a list of ComEventSinkMethod objects - which represent
|
||||
/// a single method on the source interface an a multicast delegate to redirect
|
||||
/// the calls. Notice that we are chaining multicast delegates so that same
|
||||
/// ComEventSinkMedhod can invoke multiple event handlers).
|
||||
/// ComEventSinkMethod can invoke multiple event handlers).
|
||||
///
|
||||
/// ComEventSink implements an IDisposable pattern to Unadvise from the connection point.
|
||||
/// Typically, when RCW is finalized the corresponding Dispose will be triggered by
|
||||
|
||||
@@ -29,11 +29,11 @@ namespace System.Management.Automation.ComInterop
|
||||
/// ComEventSink does not, strongly speaking, implements the interface
|
||||
/// that it claims to implement - it is just "faking" it by using IReflect.
|
||||
/// Thus, Word's QIs on the pointer passed to ICP::Advise would fail. To
|
||||
/// prevent this we take advangate of RealProxy's ability of
|
||||
/// prevent this we take advantage of RealProxy's ability of
|
||||
/// "dressing up" like other classes and hence successfully respond to QIs
|
||||
/// for interfaces that it does not really support( it is OK to say
|
||||
/// "I implement this interface" for event sinks only since the common
|
||||
/// practice is to use IDistpach.Invoke when calling into event sinks).
|
||||
/// practice is to use IDispatch.Invoke when calling into event sinks).
|
||||
/// </summary>
|
||||
internal sealed class ComEventSinkProxy : RealProxy
|
||||
{
|
||||
|
||||
@@ -31,7 +31,7 @@ namespace System.Management.Automation.ComInterop
|
||||
|
||||
private VarEnumSelector _varEnumSelector;
|
||||
private string[] _keywordArgNames;
|
||||
private int _totalExplicitArgs; // Includes the individial elements of ArgumentKind.Dictionary (if any)
|
||||
private int _totalExplicitArgs; // Includes the individual elements of ArgumentKind.Dictionary (if any)
|
||||
|
||||
private ParameterExpression _dispatchObject;
|
||||
private ParameterExpression _dispatchPointer;
|
||||
@@ -249,7 +249,7 @@ namespace System.Management.Automation.ComInterop
|
||||
}
|
||||
else
|
||||
{
|
||||
// Positial arguments are in reverse order at the tail of rgArgs
|
||||
// Positional arguments are in reverse order at the tail of rgArgs
|
||||
variantIndex = reverseIndex;
|
||||
}
|
||||
VariantBuilder variantBuilder = _varEnumSelector.VariantBuilders[i];
|
||||
|
||||
@@ -26,7 +26,7 @@ namespace System.Management.Automation.ComInterop
|
||||
# region ctor
|
||||
|
||||
/// <summary>
|
||||
/// Creates a representation for the paramter of a COM method
|
||||
/// Creates a representation for the parameter of a COM method
|
||||
/// </summary>
|
||||
internal ComParamDesc(ref ELEMDESC elemDesc, string name)
|
||||
{
|
||||
|
||||
@@ -59,7 +59,7 @@ namespace System.Management.Automation.ComInterop
|
||||
|
||||
/// <summary>
|
||||
/// Reads the latest registered type library for the corresponding GUID,
|
||||
/// reads definitions of CoClass'es and Enum's from this library
|
||||
/// reads definitions of CoClasses and Enum's from this library
|
||||
/// and creates a IDynamicMetaObjectProvider that allows to instantiate coclasses
|
||||
/// and get actual values for the enums.
|
||||
/// </summary>
|
||||
@@ -78,7 +78,7 @@ namespace System.Management.Automation.ComInterop
|
||||
|
||||
/// <summary>
|
||||
/// Gets an ITypeLib object from OLE Automation compatible RCW ,
|
||||
/// reads definitions of CoClass'es and Enum's from this library
|
||||
/// reads definitions of CoClasses and Enum's from this library
|
||||
/// and creates a IDynamicMetaObjectProvider that allows to instantiate coclasses
|
||||
/// and get actual values for the enums.
|
||||
/// </summary>
|
||||
|
||||
@@ -129,9 +129,9 @@ namespace System.Management.Automation.ComInterop
|
||||
private static int GetIDsOfNames(IDispatch dispatch, string name, out int dispId)
|
||||
{
|
||||
int[] dispIds = new int[1];
|
||||
Guid emtpyRiid = Guid.Empty;
|
||||
Guid emptyRiid = Guid.Empty;
|
||||
int hresult = dispatch.TryGetIDsOfNames(
|
||||
ref emtpyRiid,
|
||||
ref emptyRiid,
|
||||
new string[] { name },
|
||||
1,
|
||||
0,
|
||||
@@ -143,13 +143,13 @@ namespace System.Management.Automation.ComInterop
|
||||
|
||||
private static int Invoke(IDispatch dispatch, int memberDispId, out object result)
|
||||
{
|
||||
Guid emtpyRiid = Guid.Empty;
|
||||
Guid emptyRiid = Guid.Empty;
|
||||
ComTypes.DISPPARAMS dispParams = new ComTypes.DISPPARAMS();
|
||||
ComTypes.EXCEPINFO excepInfo = new ComTypes.EXCEPINFO();
|
||||
uint argErr;
|
||||
int hresult = dispatch.TryInvoke(
|
||||
memberDispId,
|
||||
ref emtpyRiid,
|
||||
ref emptyRiid,
|
||||
0,
|
||||
ComTypes.INVOKEKIND.INVOKE_PROPERTYGET,
|
||||
ref dispParams,
|
||||
@@ -491,7 +491,7 @@ namespace System.Management.Automation.ComInterop
|
||||
|
||||
// Sometimes coclass has multiple source interfaces. Usually this is caused by
|
||||
// adding new events and putting them on new interfaces while keeping the
|
||||
// old interfaces around. This may cause name collisioning which we are
|
||||
// old interfaces around. This may cause name collisions which we are
|
||||
// resolving by keeping only the first event with the same name.
|
||||
if (events.ContainsKey(name) == false)
|
||||
{
|
||||
|
||||
@@ -489,7 +489,7 @@ namespace System.Management.Automation.ComInterop
|
||||
}
|
||||
|
||||
|
||||
// This helper is called when we are looking for a ByVal marhsalling
|
||||
// This helper is called when we are looking for a ByVal marshalling
|
||||
// In a ByVal case we can take into account conversions or IConvertible if all other
|
||||
// attempts to find marshalling type failed
|
||||
private static ArgBuilder GetByValArgBuilder(Type elementType, ref VarEnum elementVarEnum)
|
||||
|
||||
@@ -51,7 +51,7 @@ namespace System.Management.Automation.ComInterop
|
||||
internal static class VariantArray
|
||||
{
|
||||
// Don't need a dictionary for this, it will have very few elements
|
||||
// (guarenteed less than 28, in practice 0-2)
|
||||
// (guaranteed less than 28, in practice 0-2)
|
||||
private static readonly List<Type> s_generatedTypes = new List<Type>(0);
|
||||
|
||||
internal static MemberExpression GetStructField(ParameterExpression variantArray, int field)
|
||||
|
||||
@@ -891,7 +891,7 @@ namespace System.Management.Automation
|
||||
|
||||
// NTRAID#Windows Out Of Band Releases-927933-2006/03/13-JeffJon
|
||||
// Need to detect when the path is a provider-direct path and make sure
|
||||
// to remove the provider-qualifer when the resolved path is returned.
|
||||
// to remove the provider-qualifier when the resolved path is returned.
|
||||
bool isProviderDirectPath = lastWord.StartsWith(@"\\", StringComparison.Ordinal) ||
|
||||
lastWord.StartsWith("//", StringComparison.Ordinal);
|
||||
|
||||
@@ -1167,7 +1167,7 @@ namespace System.Management.Automation
|
||||
/// </param>
|
||||
/// <param name="closingQuote">
|
||||
/// Receives the quote character that would be needed to end the sentence with a balanced pair of quotes. For
|
||||
/// instance, if sentence is "foo then " is returned, if sentence if "foo" then nothing is resturned, if sentence is
|
||||
/// instance, if sentence is "foo then " is returned, if sentence if "foo" then nothing is returned, if sentence is
|
||||
/// 'foo then ' is returned, if sentence is 'foo' then nothing is returned.
|
||||
/// </param>
|
||||
/// <returns>The last word located, or the empty string if no word could be found.</returns>
|
||||
|
||||
@@ -417,7 +417,7 @@ namespace System.Management.Automation
|
||||
break;
|
||||
|
||||
case TokenKind.Comma:
|
||||
// Hanlde array elements such as dir .\cd,<tab> || dir -Path: .\cd,<tab>
|
||||
// Handle array elements such as dir .\cd,<tab> || dir -Path: .\cd,<tab>
|
||||
if (lastAst is ErrorExpressionAst &&
|
||||
(lastAst.Parent is CommandAst || lastAst.Parent is CommandParameterAst))
|
||||
{
|
||||
@@ -561,7 +561,7 @@ namespace System.Management.Automation
|
||||
//
|
||||
// Handle following scenario, cursor is in next line and after a command call,
|
||||
// we need to skip the command call autocompletion if there is no backtick character
|
||||
// in the end of the prevous line, since backtick means command call continues to the next line
|
||||
// in the end of the previous line, since backtick means command call continues to the next line
|
||||
//
|
||||
// Configuration config
|
||||
// {
|
||||
@@ -596,7 +596,7 @@ namespace System.Management.Automation
|
||||
// new-object System.Drawing.Point -prop @{ X = 100; Y = <- Incomplete line
|
||||
// new-object new-object System.Drawing.Point -prop @{ X = <- Tab will yield hash properties.
|
||||
if (hashTableAst != null &&
|
||||
CheckForPendingAssigment(hashTableAst))
|
||||
CheckForPendingAssignment(hashTableAst))
|
||||
{
|
||||
return result;
|
||||
}
|
||||
@@ -777,7 +777,7 @@ namespace System.Management.Automation
|
||||
return result;
|
||||
}
|
||||
|
||||
// Helper method to auto complete hashtale key
|
||||
// Helper method to auto complete hashtable key
|
||||
private List<CompletionResult> GetResultForHashtable(CompletionContext completionContext)
|
||||
{
|
||||
var lastAst = completionContext.RelatedAsts.Last();
|
||||
@@ -837,7 +837,7 @@ namespace System.Management.Automation
|
||||
}
|
||||
|
||||
// Helper method to look for an incomplete assignment pair in hash table.
|
||||
private bool CheckForPendingAssigment(HashtableAst hashTableAst)
|
||||
private bool CheckForPendingAssignment(HashtableAst hashTableAst)
|
||||
{
|
||||
foreach (var keyValue in hashTableAst.KeyValuePairs)
|
||||
{
|
||||
@@ -1214,7 +1214,7 @@ namespace System.Management.Automation
|
||||
replacementIndex = completionContext.ReplacementIndex;
|
||||
replacementLength = completionContext.ReplacementLength;
|
||||
}
|
||||
// Hanlde scenarios like this: "c:\wind"<tab>. Treat the StringLiteral/StringExpandable as path/command
|
||||
// Handle scenarios like this: "c:\wind"<tab>. Treat the StringLiteral/StringExpandable as path/command
|
||||
else
|
||||
{
|
||||
// Handle path/commandname completion for quoted string
|
||||
|
||||
@@ -1805,7 +1805,7 @@ namespace System.Management.Automation
|
||||
NativeCommandArgumentCompletion(commandName, parameter.Parameter, result, commandAst, context, boundArguments);
|
||||
}
|
||||
|
||||
private static IEnumerable<PSTypeName> NativeCommandArgumentCompletion_InferTypesOfArugment(
|
||||
private static IEnumerable<PSTypeName> NativeCommandArgumentCompletion_InferTypesOfArgument(
|
||||
Dictionary<string, AstParameterArgumentPair> boundArguments,
|
||||
CommandAst commandAst,
|
||||
CompletionContext context,
|
||||
@@ -2527,7 +2527,7 @@ namespace System.Management.Automation
|
||||
else if (boundArguments != null && boundArguments.ContainsKey("InputObject"))
|
||||
{
|
||||
gotInstance = true;
|
||||
cimClassTypeNames = NativeCommandArgumentCompletion_InferTypesOfArugment(boundArguments, commandAst, context, "InputObject");
|
||||
cimClassTypeNames = NativeCommandArgumentCompletion_InferTypesOfArgument(boundArguments, commandAst, context, "InputObject");
|
||||
}
|
||||
|
||||
if (cimClassTypeNames != null)
|
||||
@@ -3893,7 +3893,7 @@ namespace System.Management.Automation
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Find the location where 'tab' is typed based on the line and colum.
|
||||
/// Find the location where 'tab' is typed based on the line and column.
|
||||
/// </summary>
|
||||
private static ArgumentLocation FindTargetArgumentLocation(Collection<AstParameterArgumentPair> parsedArguments, Token token)
|
||||
{
|
||||
@@ -4326,7 +4326,7 @@ namespace System.Management.Automation
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
// The object at the specifie path is not accessable, such as c:\hiberfil.sys (for hibernation) or c:\pagefile.sys (for paging)
|
||||
// The object at the specified path is not accessable, such as c:\hiberfil.sys (for hibernation) or c:\pagefile.sys (for paging)
|
||||
// We ignore those files
|
||||
CommandProcessorBase.CheckForSevereException(e);
|
||||
continue;
|
||||
@@ -5857,8 +5857,8 @@ namespace System.Management.Automation
|
||||
|
||||
#region Process_LoadedAssemblies
|
||||
|
||||
var assembliesExludingPSGenerated = ClrFacade.GetAssemblies();
|
||||
var allPublicTypes = assembliesExludingPSGenerated.SelectMany(assembly => assembly.GetTypes().Where(TypeResolver.IsPublic));
|
||||
var assembliesExcludingPSGenerated = ClrFacade.GetAssemblies();
|
||||
var allPublicTypes = assembliesExcludingPSGenerated.SelectMany(assembly => assembly.GetTypes().Where(TypeResolver.IsPublic));
|
||||
|
||||
foreach (var type in allPublicTypes)
|
||||
{
|
||||
@@ -6064,7 +6064,7 @@ namespace System.Management.Automation
|
||||
}
|
||||
}
|
||||
|
||||
//this is a temparary fix. Only the type defined in the same script get complete. Need to use using Module when that is available.
|
||||
//this is a temporary fix. Only the type defined in the same script get complete. Need to use using Module when that is available.
|
||||
var scriptBlockAst = (ScriptBlockAst)context.RelatedAsts[0];
|
||||
var typeAsts = scriptBlockAst.FindAll(ast => ast is TypeDefinitionAst, false).Cast<TypeDefinitionAst>();
|
||||
foreach (var typeAst in typeAsts.Where(ast => pattern.IsMatch(ast.Name)))
|
||||
@@ -6251,7 +6251,7 @@ namespace System.Management.Automation
|
||||
{
|
||||
Diagnostics.Assert(ast.Keyword != null, "DynamicKeywordStatementAst.Keyword can never be null");
|
||||
List<CompletionResult> results = null;
|
||||
var dynamicKeywordProperies = ast.Keyword.Properties;
|
||||
var dynamicKeywordProperties = ast.Keyword.Properties;
|
||||
var memberPattern = completionContext.WordToComplete + "*";
|
||||
|
||||
//
|
||||
@@ -6269,10 +6269,10 @@ namespace System.Management.Automation
|
||||
}
|
||||
}
|
||||
|
||||
if (dynamicKeywordProperies.Count > 0)
|
||||
if (dynamicKeywordProperties.Count > 0)
|
||||
{
|
||||
// Excludes existing properties in the hashtable statement
|
||||
var tempProperties = dynamicKeywordProperies.Where(p => !propertiesName.Contains(p.Key, StringComparer.OrdinalIgnoreCase));
|
||||
var tempProperties = dynamicKeywordProperties.Where(p => !propertiesName.Contains(p.Key, StringComparer.OrdinalIgnoreCase));
|
||||
if (tempProperties != null && tempProperties.Any())
|
||||
{
|
||||
results = new List<CompletionResult>();
|
||||
|
||||
+1
-1
@@ -12,7 +12,7 @@ namespace System.Management.Automation
|
||||
using System.Collections;
|
||||
|
||||
/// <summary>
|
||||
/// Auxilliary class to the execution of commands as needed by
|
||||
/// Auxiliary class to the execution of commands as needed by
|
||||
/// CommandCompletion
|
||||
/// </summary>
|
||||
internal class CompletionExecutionHelper
|
||||
|
||||
+14
-14
@@ -333,7 +333,7 @@ namespace System.Management.Automation.Language
|
||||
PseudoBindingInfo pseudoBinding = null;
|
||||
if (Runspace.DefaultRunspace == null)
|
||||
{
|
||||
lock (s_bindCommandlLock)
|
||||
lock (s_bindCommandLock)
|
||||
{
|
||||
if (s_bindCommandPowerShell == null)
|
||||
{
|
||||
@@ -360,7 +360,7 @@ namespace System.Management.Automation.Language
|
||||
|
||||
return new StaticBindingResult(commandAst, pseudoBinding);
|
||||
}
|
||||
private static Object s_bindCommandlLock = new Object();
|
||||
private static Object s_bindCommandLock = new Object();
|
||||
private static PowerShell s_bindCommandPowerShell = null;
|
||||
}
|
||||
|
||||
@@ -809,7 +809,7 @@ namespace System.Management.Automation.Language
|
||||
/// </summary>
|
||||
/// <param name="commandInfo"></param>
|
||||
/// <param name="validParameterSetsFlags"></param>
|
||||
/// <param name="defaultParameterSetFalg"></param>
|
||||
/// <param name="defaultParameterSetFlag"></param>
|
||||
/// <param name="boundParameters"></param>
|
||||
/// <param name="unboundParameters"></param>
|
||||
/// <param name="boundArguments"></param>
|
||||
@@ -823,7 +823,7 @@ namespace System.Management.Automation.Language
|
||||
internal PseudoBindingInfo(
|
||||
CommandInfo commandInfo,
|
||||
uint validParameterSetsFlags,
|
||||
uint defaultParameterSetFalg,
|
||||
uint defaultParameterSetFlag,
|
||||
Dictionary<string, MergedCompiledCommandParameter> boundParameters,
|
||||
List<MergedCompiledCommandParameter> unboundParameters,
|
||||
Dictionary<string, AstParameterArgumentPair> boundArguments,
|
||||
@@ -838,7 +838,7 @@ namespace System.Management.Automation.Language
|
||||
CommandInfo = commandInfo;
|
||||
InfoType = PseudoBindingInfoType.PseudoBindingSucceed;
|
||||
ValidParameterSetsFlags = validParameterSetsFlags;
|
||||
DefaultParameterSetFlag = defaultParameterSetFalg;
|
||||
DefaultParameterSetFlag = defaultParameterSetFlag;
|
||||
BoundParameters = boundParameters;
|
||||
UnboundParameters = unboundParameters;
|
||||
BoundArguments = boundArguments;
|
||||
@@ -1095,7 +1095,7 @@ namespace System.Management.Automation.Language
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Restores original ExceutionContext host state.
|
||||
/// Restores original ExecutionContext host state.
|
||||
/// </summary>
|
||||
/// <param name="executionContext">ExecutionContext</param>
|
||||
private void RestoreHost(ExecutionContext executionContext)
|
||||
@@ -1118,7 +1118,7 @@ namespace System.Management.Automation.Language
|
||||
private CommandAst _commandAst;
|
||||
private ReadOnlyCollection<CommandElementAst> _commandElements;
|
||||
|
||||
// binding realted states
|
||||
// binding related states
|
||||
private bool _function = false;
|
||||
private string _commandName = null;
|
||||
private CommandInfo _commandInfo = null;
|
||||
@@ -1152,7 +1152,7 @@ namespace System.Management.Automation.Language
|
||||
_ignoredWorkflowParameters = new List<string>(Cmdlet.CommonParameters.Concat<string>(Cmdlet.OptionalCommonParameters));
|
||||
_ignoredWorkflowParameters.RemoveAll(item => supportedCommonParameters.Contains(item, StringComparer.OrdinalIgnoreCase));
|
||||
|
||||
// Initializing binding realted members
|
||||
// Initializing binding related members
|
||||
_function = false;
|
||||
_commandName = null;
|
||||
_currentParameterSetFlag = uint.MaxValue;
|
||||
@@ -1285,7 +1285,7 @@ namespace System.Management.Automation.Language
|
||||
context.CurrentCommandProcessor = commandProcessor;
|
||||
commandProcessor.SetCurrentScopeToExecutionScope();
|
||||
// Run method "BindCommandLineParametersNoValidation" to get all available parameters, including the dynamic
|
||||
// parameters (some of them, not necessarilly all. Since we don't do the actual binding, some dynamic parameters
|
||||
// parameters (some of them, not necessarily all. Since we don't do the actual binding, some dynamic parameters
|
||||
// might not be retrieved).
|
||||
if (!retryWithNoArgs)
|
||||
{
|
||||
@@ -1621,7 +1621,7 @@ namespace System.Management.Automation.Language
|
||||
catch (ParameterBindingException e)
|
||||
{
|
||||
// The parameterName is resolved to multiple parameters. The most possible scenario for this
|
||||
// would be the user typping tab to complete a parameter. In this case, we can ignore this
|
||||
// would be the user typing tab to complete a parameter. In this case, we can ignore this
|
||||
// parameter safely.
|
||||
|
||||
// If the next item is a pure argument, we skip it so that it doesn't get bound
|
||||
@@ -1723,7 +1723,7 @@ namespace System.Management.Automation.Language
|
||||
catch (ParameterBindingException)
|
||||
{
|
||||
// The next parameter name is ambiguous. We just set
|
||||
// a fake argument for the current paramter.
|
||||
// a fake argument for the current parameter.
|
||||
FakePair newArg = new FakePair(argument.Parameter);
|
||||
result.Add(newArg);
|
||||
}
|
||||
@@ -1839,7 +1839,7 @@ namespace System.Management.Automation.Language
|
||||
catch (InvalidOperationException)
|
||||
{
|
||||
// This exception is thrown because the binder found two positional parameters
|
||||
// from the same parameter set with the same position defined. The parameter denition
|
||||
// from the same parameter set with the same position defined. The parameter definition
|
||||
// is ambiguous. We give up binding in this case
|
||||
_bindingEffective = false;
|
||||
return result;
|
||||
@@ -1867,7 +1867,7 @@ namespace System.Management.Automation.Language
|
||||
break;
|
||||
}
|
||||
|
||||
// The positional pseudo binding is processed in two different approches for parameter completion and parameter argument completion.
|
||||
// The positional pseudo binding is processed in two different approaches for parameter completion and parameter argument completion.
|
||||
// - For parameter completion, we do NOT honor the default parameter set, so we can preserve potential parameters as many as possible.
|
||||
// Example:
|
||||
// Where-Object PropertyA -<tab>
|
||||
@@ -2011,7 +2011,7 @@ namespace System.Management.Automation.Language
|
||||
}
|
||||
}
|
||||
|
||||
// We preserve all posibilities
|
||||
// We preserve all possibilities
|
||||
if (bindingSuccessful && localParameterSetFlag != 0)
|
||||
_currentParameterSetFlag &= localParameterSetFlag;
|
||||
return bindingSuccessful;
|
||||
|
||||
@@ -558,7 +558,7 @@ namespace System.Management.Automation
|
||||
// #Requires -Module
|
||||
internal static void VerifyScriptRequirements(ExternalScriptInfo scriptInfo, ExecutionContext context)
|
||||
{
|
||||
VerifyElevatedPriveleges(scriptInfo);
|
||||
VerifyElevatedPrivileges(scriptInfo);
|
||||
VerifyPSVersion(scriptInfo);
|
||||
VerifyPSEdition(scriptInfo);
|
||||
VerifyRequiredModules(scriptInfo, context);
|
||||
@@ -616,7 +616,7 @@ namespace System.Management.Automation
|
||||
}
|
||||
}
|
||||
|
||||
internal static void VerifyElevatedPriveleges(ExternalScriptInfo scriptInfo)
|
||||
internal static void VerifyElevatedPrivileges(ExternalScriptInfo scriptInfo)
|
||||
{
|
||||
bool requiresElevation = scriptInfo.RequiresElevation;
|
||||
bool isAdministrator = Utils.IsAdministrator();
|
||||
|
||||
@@ -1644,13 +1644,13 @@ namespace Microsoft.PowerShell.Commands
|
||||
{
|
||||
if (!WildcardPattern.ContainsWildcardCharacters(_property))
|
||||
{
|
||||
PSMemberInfoInternalCollection<PSMemberInfo> restuls = new PSMemberInfoInternalCollection<PSMemberInfo>();
|
||||
PSMemberInfoInternalCollection<PSMemberInfo> results = new PSMemberInfoInternalCollection<PSMemberInfo>();
|
||||
PSMemberInfo member = _inputObject.Members[_property];
|
||||
if (member != null)
|
||||
{
|
||||
restuls.Add(member);
|
||||
results.Add(member);
|
||||
}
|
||||
return new ReadOnlyPSMemberInfoCollection<PSMemberInfo>(restuls);
|
||||
return new ReadOnlyPSMemberInfoCollection<PSMemberInfo>(results);
|
||||
}
|
||||
|
||||
ReadOnlyPSMemberInfoCollection<PSMemberInfo> members = _inputObject.Members.Match(_property, PSMemberTypes.All);
|
||||
|
||||
@@ -123,17 +123,17 @@ namespace System.Management.Automation
|
||||
var hadFunctions = AddPsd1EntryToResult(result, moduleManifestProperties["FunctionsToExport"], CommandTypes.Function, ref sawWildcard);
|
||||
var hadAliases = AddPsd1EntryToResult(result, moduleManifestProperties["AliasesToExport"], CommandTypes.Alias, ref sawWildcard);
|
||||
|
||||
var analysisSuceeded = hadCmdlets && hadFunctions && hadAliases;
|
||||
var analysisSucceeded = hadCmdlets && hadFunctions && hadAliases;
|
||||
|
||||
if (!analysisSuceeded && !sawWildcard && (hadCmdlets || hadFunctions))
|
||||
if (!analysisSucceeded && !sawWildcard && (hadCmdlets || hadFunctions))
|
||||
{
|
||||
// If we're missing CmdletsToExport, that might still be OK, but only if we have a script module.
|
||||
// Likewise, if we're missing FunctionsToExport, that might be OK, but only if we have a binary module.
|
||||
|
||||
analysisSuceeded = !CheckModulesTypesInManifestAgainstExportedCommands(moduleManifestProperties, hadCmdlets, hadFunctions, hadAliases);
|
||||
analysisSucceeded = !CheckModulesTypesInManifestAgainstExportedCommands(moduleManifestProperties, hadCmdlets, hadFunctions, hadAliases);
|
||||
}
|
||||
|
||||
if (analysisSuceeded)
|
||||
if (analysisSucceeded)
|
||||
{
|
||||
var moduleCacheEntry = new ModuleCacheEntry
|
||||
{
|
||||
|
||||
@@ -762,12 +762,12 @@ namespace Microsoft.PowerShell.Commands
|
||||
Version version;
|
||||
if (Version.TryParse(subdirName, out version))
|
||||
{
|
||||
var modueBaseWithoutVersion = Path.GetDirectoryName(tempModuleInfoFromVerification.ModuleBase);
|
||||
var moduleBaseWithoutVersion = Path.GetDirectoryName(tempModuleInfoFromVerification.ModuleBase);
|
||||
|
||||
modulePath = new string[]
|
||||
{
|
||||
Path.GetDirectoryName(modueBaseWithoutVersion),
|
||||
modueBaseWithoutVersion
|
||||
Path.GetDirectoryName(moduleBaseWithoutVersion),
|
||||
moduleBaseWithoutVersion
|
||||
};
|
||||
}
|
||||
else
|
||||
@@ -1874,24 +1874,24 @@ namespace Microsoft.PowerShell.Commands
|
||||
}
|
||||
|
||||
// Test the required processor architecture
|
||||
ProcessorArchitecture requiredProcesorArchitecture;
|
||||
ProcessorArchitecture requiredProcessorArchitecture;
|
||||
if (
|
||||
!GetScalarFromData(data, moduleManifestPath, "ProcessorArchitecture", manifestProcessingFlags,
|
||||
out requiredProcesorArchitecture))
|
||||
out requiredProcessorArchitecture))
|
||||
{
|
||||
containedErrors = true;
|
||||
if (bailOnFirstError) return null;
|
||||
}
|
||||
else if ((requiredProcesorArchitecture != ProcessorArchitecture.None) &&
|
||||
(requiredProcesorArchitecture != ProcessorArchitecture.MSIL))
|
||||
else if ((requiredProcessorArchitecture != ProcessorArchitecture.None) &&
|
||||
(requiredProcessorArchitecture != ProcessorArchitecture.MSIL))
|
||||
{
|
||||
bool isRunningOnArm = false;
|
||||
ProcessorArchitecture currentArchitecture = PsUtils.GetProcessorArchitecture(out isRunningOnArm);
|
||||
|
||||
// For ARM Architectures, we need to do additional string-level comparison
|
||||
if ((currentArchitecture != requiredProcesorArchitecture && !isRunningOnArm) ||
|
||||
if ((currentArchitecture != requiredProcessorArchitecture && !isRunningOnArm) ||
|
||||
(isRunningOnArm &&
|
||||
!requiredProcesorArchitecture.ToString()
|
||||
!requiredProcessorArchitecture.ToString()
|
||||
.Equals(PsUtils.ArmArchitecture, StringComparison.OrdinalIgnoreCase)))
|
||||
{
|
||||
containedErrors = true;
|
||||
@@ -1901,7 +1901,7 @@ namespace Microsoft.PowerShell.Commands
|
||||
? PsUtils.ArmArchitecture
|
||||
: currentArchitecture.ToString();
|
||||
message = StringUtil.Format(Modules.InvalidProcessorArchitecture,
|
||||
actualCurrentArchitecture, moduleManifestPath, requiredProcesorArchitecture);
|
||||
actualCurrentArchitecture, moduleManifestPath, requiredProcessorArchitecture);
|
||||
InvalidOperationException ioe = new InvalidOperationException(message);
|
||||
ErrorRecord er = new ErrorRecord(ioe, "Modules_InvalidProcessorArchitecture",
|
||||
ErrorCategory.ResourceUnavailable, moduleManifestPath);
|
||||
@@ -2527,7 +2527,7 @@ namespace Microsoft.PowerShell.Commands
|
||||
manifestInfo.PowerShellHostName = requestedHostName;
|
||||
manifestInfo.PowerShellHostVersion = requestedHostVersion;
|
||||
manifestInfo.PowerShellVersion = powerShellVersion;
|
||||
manifestInfo.ProcessorArchitecture = requiredProcesorArchitecture;
|
||||
manifestInfo.ProcessorArchitecture = requiredProcessorArchitecture;
|
||||
manifestInfo.Prefix = resolvedCommandPrefix;
|
||||
if (assemblyList != null)
|
||||
{
|
||||
@@ -2540,8 +2540,8 @@ namespace Microsoft.PowerShell.Commands
|
||||
{
|
||||
foreach (var f in fileList)
|
||||
{
|
||||
string absuluteFilePath = GetAbsolutePath(moduleBase, f);
|
||||
manifestInfo.AddToFileList(absuluteFilePath);
|
||||
string absoluteFilePath = GetAbsolutePath(moduleBase, f);
|
||||
manifestInfo.AddToFileList(absoluteFilePath);
|
||||
}
|
||||
}
|
||||
if (moduleList != null)
|
||||
@@ -2892,7 +2892,7 @@ namespace Microsoft.PowerShell.Commands
|
||||
null, //SessionState
|
||||
nestedModuleOptions,
|
||||
manifestProcessingFlags,
|
||||
false, // addToParentModueIfFound
|
||||
false, // addToParentModuleIfFound
|
||||
out found);
|
||||
}
|
||||
else
|
||||
@@ -3303,7 +3303,7 @@ namespace Microsoft.PowerShell.Commands
|
||||
|
||||
if (newManifestInfo.ProcessorArchitecture == ProcessorArchitecture.None)
|
||||
{
|
||||
newManifestInfo.ProcessorArchitecture = requiredProcesorArchitecture;
|
||||
newManifestInfo.ProcessorArchitecture = requiredProcessorArchitecture;
|
||||
}
|
||||
|
||||
if (newManifestInfo.RequiredAssemblies == null || newManifestInfo.RequiredAssemblies.LongCount() == 0)
|
||||
@@ -3627,7 +3627,7 @@ namespace Microsoft.PowerShell.Commands
|
||||
private readonly string _serviceCoreAssemblyFullName = "Microsoft.Powershell.Workflow.ServiceCore, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL";
|
||||
private readonly string _serviceCoreAssemblyShortName = "Microsoft.Powershell.Workflow.ServiceCore";
|
||||
|
||||
private PSModuleInfo LoadServiceCoreModule(PSModuleInfo parentModule, string moduleBase, SessionState ss, ImportModuleOptions nestedModuleOptions, ManifestProcessingFlags manifestProcessingFlags, bool addToParentModueIfFound, out bool found)
|
||||
private PSModuleInfo LoadServiceCoreModule(PSModuleInfo parentModule, string moduleBase, SessionState ss, ImportModuleOptions nestedModuleOptions, ManifestProcessingFlags manifestProcessingFlags, bool addToParentModuleIfFound, out bool found)
|
||||
{
|
||||
SessionStateInternal oldSessionState = Context.EngineSessionState;
|
||||
|
||||
@@ -3663,7 +3663,7 @@ namespace Microsoft.PowerShell.Commands
|
||||
// If found, add it to the parent's list of NestedModules
|
||||
if (found)
|
||||
{
|
||||
if (addToParentModueIfFound)
|
||||
if (addToParentModuleIfFound)
|
||||
{
|
||||
parentModule.AddNestedModule(nestedModule);
|
||||
}
|
||||
|
||||
@@ -881,9 +881,9 @@ namespace Microsoft.PowerShell.Commands
|
||||
_exportedCmdlets = new string[] { "*" };
|
||||
}
|
||||
|
||||
ValidateUriParamterValue(ProjectUri, "ProjectUri");
|
||||
ValidateUriParamterValue(LicenseUri, "LicenseUri");
|
||||
ValidateUriParamterValue(IconUri, "IconUri");
|
||||
ValidateUriParameterValue(ProjectUri, "ProjectUri");
|
||||
ValidateUriParameterValue(LicenseUri, "LicenseUri");
|
||||
ValidateUriParameterValue(IconUri, "IconUri");
|
||||
|
||||
if (CompatiblePSEditions != null && (CompatiblePSEditions.Distinct(StringComparer.OrdinalIgnoreCase).Count() != CompatiblePSEditions.Count()))
|
||||
{
|
||||
@@ -1131,7 +1131,7 @@ namespace Microsoft.PowerShell.Commands
|
||||
}
|
||||
}
|
||||
|
||||
private void ValidateUriParamterValue(Uri uri, string parameterName)
|
||||
private void ValidateUriParameterValue(Uri uri, string parameterName)
|
||||
{
|
||||
Dbg.Assert(!String.IsNullOrWhiteSpace(parameterName), "parameterName should not be null or whitespace");
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ namespace System.Management.Automation
|
||||
|
||||
/// Used by Remoting infrastructure. This TypeTable instance
|
||||
/// will be used by Serializer if ExecutionContext is not
|
||||
/// avaliable (to get the ExecutionContext's TypeTable)
|
||||
/// available (to get the ExecutionContext's TypeTable)
|
||||
private TypeTable _typeTable;
|
||||
|
||||
private Collection<CollectionEntry<PSPropertyInfo>> _allPropertiesCollection;
|
||||
|
||||
@@ -228,7 +228,7 @@ namespace System.Management.Automation
|
||||
}
|
||||
|
||||
|
||||
internal static string GetRegisteryVersionKeyForSnapinDiscovery(string majorVersion)
|
||||
internal static string GetRegistryVersionKeyForSnapinDiscovery(string majorVersion)
|
||||
{
|
||||
int tempMajorVersion = 0;
|
||||
LanguagePrimitives.TryConvertTo<int>(majorVersion, out tempMajorVersion);
|
||||
|
||||
@@ -2052,14 +2052,14 @@ namespace System.Management.Automation
|
||||
if (_dictionary.ImplicitUsingParameters == null)
|
||||
{
|
||||
// Handle downlevel V4 case where using parameters are passed as an array list.
|
||||
IList implictArrayUsingParameters = PSObject.Base(obj) as IList;
|
||||
if ((implictArrayUsingParameters != null) && (implictArrayUsingParameters.Count > 0))
|
||||
IList implicitArrayUsingParameters = PSObject.Base(obj) as IList;
|
||||
if ((implicitArrayUsingParameters != null) && (implicitArrayUsingParameters.Count > 0))
|
||||
{
|
||||
// Convert array to hash table.
|
||||
_dictionary.ImplicitUsingParameters = new Hashtable();
|
||||
for (int index = 0; index < implictArrayUsingParameters.Count; index++)
|
||||
for (int index = 0; index < implicitArrayUsingParameters.Count; index++)
|
||||
{
|
||||
_dictionary.ImplicitUsingParameters.Add(index, implictArrayUsingParameters[index]);
|
||||
_dictionary.ImplicitUsingParameters.Add(index, implicitArrayUsingParameters[index]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -704,10 +704,10 @@ namespace System.Management.Automation
|
||||
}
|
||||
|
||||
// ConstrainedLanguage note - This conversion is analyzed, but actually invoked via regular conversion.
|
||||
var convertionData = LanguagePrimitives.FigureConversion(dotNetType, this.ParameterType);
|
||||
if (convertionData != null)
|
||||
var conversionData = LanguagePrimitives.FigureConversion(dotNetType, this.ParameterType);
|
||||
if (conversionData != null)
|
||||
{
|
||||
if ((int)(convertionData.Rank) >= (int)(ConversionRank.NumericImplicitS2A))
|
||||
if ((int)(conversionData.Rank) >= (int)(ConversionRank.NumericImplicitS2A))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1742,7 +1742,7 @@ namespace Microsoft.PowerShell.Commands
|
||||
}
|
||||
set
|
||||
{
|
||||
_countParamterSpecified = true;
|
||||
_countParameterSpecified = true;
|
||||
_count = value;
|
||||
}
|
||||
}
|
||||
@@ -1755,7 +1755,7 @@ namespace Microsoft.PowerShell.Commands
|
||||
/// <summary>
|
||||
/// a boolean variable to indicate if the count parameter specified
|
||||
/// </summary>
|
||||
private bool _countParamterSpecified = false;
|
||||
private bool _countParameterSpecified = false;
|
||||
|
||||
/// <summary>
|
||||
/// Specifies whether new entries to be cleared or the default old ones.
|
||||
@@ -1824,7 +1824,7 @@ namespace Microsoft.PowerShell.Commands
|
||||
/// </summary>
|
||||
private void ClearHistoryByID()
|
||||
{
|
||||
if (_countParamterSpecified && Count < 0)
|
||||
if (_countParameterSpecified && Count < 0)
|
||||
{
|
||||
Exception ex =
|
||||
new ArgumentException
|
||||
@@ -1846,7 +1846,7 @@ namespace Microsoft.PowerShell.Commands
|
||||
if (_id != null)
|
||||
{
|
||||
// if count parameter is not present
|
||||
if (!_countParamterSpecified)
|
||||
if (!_countParameterSpecified)
|
||||
{
|
||||
// clearing the entry for each id in the id[] parameter.
|
||||
foreach (long id in _id)
|
||||
@@ -1908,7 +1908,7 @@ namespace Microsoft.PowerShell.Commands
|
||||
else
|
||||
{
|
||||
// confirmation message if all the clearhistory cmdlet is used without any parameters
|
||||
if (_countParamterSpecified == false)
|
||||
if (_countParameterSpecified == false)
|
||||
{
|
||||
string message = StringUtil.Format(HistoryStrings.ClearHistoryWarning, "Warning");// "The command would clear all the entry(s) from the session history,Are you sure you want to continue ?";
|
||||
if (!ShouldProcess(message))
|
||||
@@ -1933,7 +1933,7 @@ namespace Microsoft.PowerShell.Commands
|
||||
private void ClearHistoryByCmdLine()
|
||||
{
|
||||
// throw an exception for invalid count values
|
||||
if (_countParamterSpecified && Count < 0)
|
||||
if (_countParameterSpecified && Count < 0)
|
||||
{
|
||||
Exception ex =
|
||||
new ArgumentException
|
||||
@@ -1956,7 +1956,7 @@ namespace Microsoft.PowerShell.Commands
|
||||
if (_commandline != null)
|
||||
{
|
||||
// if count parameter is not present
|
||||
if (!_countParamterSpecified)
|
||||
if (!_countParameterSpecified)
|
||||
{
|
||||
foreach (string cmd in _commandline)
|
||||
{
|
||||
@@ -2038,7 +2038,7 @@ namespace Microsoft.PowerShell.Commands
|
||||
//creates a wild card pattern
|
||||
WildcardPattern wildcardpattern = WildcardPattern.Get(cmdline, WildcardOptions.IgnoreCase);
|
||||
//count set to zero if not specified.
|
||||
if (!_countParamterSpecified && WildcardPattern.ContainsWildcardCharacters(cmdline))
|
||||
if (!_countParameterSpecified && WildcardPattern.ContainsWildcardCharacters(cmdline))
|
||||
{
|
||||
count = 0;
|
||||
}
|
||||
|
||||
@@ -459,16 +459,16 @@ namespace System.Management.Automation.Runspaces
|
||||
// appdomins for which the debug preference has to be enabled.
|
||||
if (processDebugPreference != null)
|
||||
{
|
||||
List<string> chachedAppDomainNames = null;
|
||||
List<string> cachedAppDomainNames = null;
|
||||
if (processDebugPreference.AppDomainNames != null && processDebugPreference.AppDomainNames.Length > 0)
|
||||
{
|
||||
chachedAppDomainNames = new List<string>(processDebugPreference.AppDomainNames);
|
||||
cachedAppDomainNames = new List<string>(processDebugPreference.AppDomainNames);
|
||||
|
||||
foreach (string currentAppDomainName in appDomainName)
|
||||
{
|
||||
if (!chachedAppDomainNames.Contains(currentAppDomainName, StringComparer.OrdinalIgnoreCase))
|
||||
if (!cachedAppDomainNames.Contains(currentAppDomainName, StringComparer.OrdinalIgnoreCase))
|
||||
{
|
||||
chachedAppDomainNames.Add(currentAppDomainName);
|
||||
cachedAppDomainNames.Add(currentAppDomainName);
|
||||
iscacheUpdated = true;
|
||||
}
|
||||
}
|
||||
@@ -476,7 +476,7 @@ namespace System.Management.Automation.Runspaces
|
||||
|
||||
if (iscacheUpdated)
|
||||
{
|
||||
DebugPreference DebugPreference = CreateDebugPreference(chachedAppDomainNames.ToArray());
|
||||
DebugPreference DebugPreference = CreateDebugPreference(cachedAppDomainNames.ToArray());
|
||||
debugPreferenceCache[processName] = DebugPreference;
|
||||
}
|
||||
}
|
||||
@@ -501,17 +501,17 @@ namespace System.Management.Automation.Runspaces
|
||||
// appdomins for which the debug preference has to be enabled.
|
||||
if (processDebugPreference != null)
|
||||
{
|
||||
List<string> chachedAppDomainNames = null;
|
||||
List<string> cachedAppDomainNames = null;
|
||||
if (processDebugPreference.AppDomainNames != null && processDebugPreference.AppDomainNames.Length > 0)
|
||||
{
|
||||
chachedAppDomainNames = new List<string>(processDebugPreference.AppDomainNames);
|
||||
cachedAppDomainNames = new List<string>(processDebugPreference.AppDomainNames);
|
||||
|
||||
foreach (string currentAppDomainName in appDomainName)
|
||||
{
|
||||
if (chachedAppDomainNames.Contains(currentAppDomainName, StringComparer.OrdinalIgnoreCase))
|
||||
if (cachedAppDomainNames.Contains(currentAppDomainName, StringComparer.OrdinalIgnoreCase))
|
||||
{
|
||||
// remove requested appdomains debug preference details.
|
||||
chachedAppDomainNames.Remove(currentAppDomainName);
|
||||
cachedAppDomainNames.Remove(currentAppDomainName);
|
||||
iscacheUpdated = true;
|
||||
}
|
||||
}
|
||||
@@ -519,7 +519,7 @@ namespace System.Management.Automation.Runspaces
|
||||
|
||||
if (iscacheUpdated)
|
||||
{
|
||||
DebugPreference DebugPreference = CreateDebugPreference(chachedAppDomainNames.ToArray());
|
||||
DebugPreference DebugPreference = CreateDebugPreference(cachedAppDomainNames.ToArray());
|
||||
debugPreferenceCache[processName] = DebugPreference;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -475,8 +475,8 @@ namespace System.Management.Automation.Runspaces.Internal
|
||||
// of the pool.
|
||||
while (pool.Count > maxRunspaces)
|
||||
{
|
||||
Runspace rsToDestory = pool.Pop();
|
||||
DestroyRunspace(rsToDestory);
|
||||
Runspace rsToDestroy = pool.Pop();
|
||||
DestroyRunspace(rsToDestroy);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -376,15 +376,15 @@ namespace System.Management.Automation.Interpreter
|
||||
{
|
||||
}
|
||||
|
||||
public HybridReferenceDictionary(int initialCapicity)
|
||||
public HybridReferenceDictionary(int initialCapacity)
|
||||
{
|
||||
if (initialCapicity > _arraySize)
|
||||
if (initialCapacity > _arraySize)
|
||||
{
|
||||
_dict = new Dictionary<TKey, TValue>(initialCapicity);
|
||||
_dict = new Dictionary<TKey, TValue>(initialCapacity);
|
||||
}
|
||||
else
|
||||
{
|
||||
_keysAndValues = new KeyValuePair<TKey, TValue>[initialCapicity];
|
||||
_keysAndValues = new KeyValuePair<TKey, TValue>[initialCapacity];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -265,7 +265,7 @@ namespace System.Management.Automation.Language
|
||||
|
||||
// Return true if the character can be the first character of
|
||||
// an identifier or label.
|
||||
internal static bool IsIndentifierStart(this char c)
|
||||
internal static bool IsIdentifierStart(this char c)
|
||||
{
|
||||
if (c < 128)
|
||||
{
|
||||
@@ -276,7 +276,7 @@ namespace System.Management.Automation.Language
|
||||
|
||||
// Return true if the character can follow the first character of
|
||||
// an identifier or label.
|
||||
internal static bool IsIndentifierFollow(this char c)
|
||||
internal static bool IsIdentifierFollow(this char c)
|
||||
{
|
||||
if (c < 128)
|
||||
{
|
||||
|
||||
@@ -3604,7 +3604,7 @@ namespace System.Management.Automation.Language
|
||||
ExpressionAst body = null;
|
||||
if (keywordData.BodyMode == DynamicKeywordBodyMode.ScriptBlock)
|
||||
{
|
||||
var oldInConfiguraiton = _inConfiguration;
|
||||
var oldInConfiguration = _inConfiguration;
|
||||
try
|
||||
{
|
||||
_inConfiguration = false;
|
||||
@@ -3612,7 +3612,7 @@ namespace System.Management.Automation.Language
|
||||
}
|
||||
finally
|
||||
{
|
||||
_inConfiguration = oldInConfiguraiton;
|
||||
_inConfiguration = oldInConfiguration;
|
||||
}
|
||||
}
|
||||
else if (keywordData.BodyMode == DynamicKeywordBodyMode.Hashtable)
|
||||
|
||||
@@ -334,19 +334,19 @@ namespace System.Management.Automation.Language
|
||||
|
||||
public override AstVisitAction VisitTypeDefinition(TypeDefinitionAst typeDefinitionAst)
|
||||
{
|
||||
AttributeAst dscResourceAttibuteAst = null;
|
||||
AttributeAst dscResourceAttributeAst = null;
|
||||
for (int i = 0; i < typeDefinitionAst.Attributes.Count; i++)
|
||||
{
|
||||
var attr = typeDefinitionAst.Attributes[i];
|
||||
if (attr.TypeName.GetReflectionAttributeType() == typeof(DscResourceAttribute))
|
||||
{
|
||||
dscResourceAttibuteAst = attr;
|
||||
dscResourceAttributeAst = attr;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (dscResourceAttibuteAst != null)
|
||||
if (dscResourceAttributeAst != null)
|
||||
{
|
||||
DscResourceChecker.CheckType(_parser, typeDefinitionAst, dscResourceAttibuteAst);
|
||||
DscResourceChecker.CheckType(_parser, typeDefinitionAst, dscResourceAttributeAst);
|
||||
}
|
||||
|
||||
return AstVisitAction.Continue;
|
||||
|
||||
@@ -67,7 +67,7 @@ namespace System.Management.Automation.Language
|
||||
}
|
||||
}
|
||||
|
||||
private static Type LookForTypeInAssemblies(TypeName typeName, IEnumerable<Assembly> assemblies, TypeResolutionState typeResolutionState, bool reportAmbigousException, out Exception exception)
|
||||
private static Type LookForTypeInAssemblies(TypeName typeName, IEnumerable<Assembly> assemblies, TypeResolutionState typeResolutionState, bool reportAmbiguousException, out Exception exception)
|
||||
{
|
||||
exception = null;
|
||||
string alternateNameToFind = typeResolutionState.GetAlternateTypeName(typeName.Name);
|
||||
@@ -85,7 +85,7 @@ namespace System.Management.Automation.Language
|
||||
|
||||
if (targetType != null)
|
||||
{
|
||||
if (!reportAmbigousException)
|
||||
if (!reportAmbiguousException)
|
||||
{
|
||||
// accelerator for the common case, when we are not interested in ambiguity exception.
|
||||
return targetType;
|
||||
@@ -159,7 +159,7 @@ namespace System.Management.Automation.Language
|
||||
return true;
|
||||
}
|
||||
|
||||
private static Type ResolveTypeNameWorker(TypeName typeName, SessionStateScope currentScope, IEnumerable<Assembly> loadedAssemblies, TypeResolutionState typeResolutionState, bool reportAmbigousException, out Exception exception)
|
||||
private static Type ResolveTypeNameWorker(TypeName typeName, SessionStateScope currentScope, IEnumerable<Assembly> loadedAssemblies, TypeResolutionState typeResolutionState, bool reportAmbiguousException, out Exception exception)
|
||||
{
|
||||
Type result;
|
||||
exception = null;
|
||||
@@ -179,7 +179,7 @@ namespace System.Management.Automation.Language
|
||||
}
|
||||
|
||||
exception = null;
|
||||
result = LookForTypeInAssemblies(typeName, loadedAssemblies, typeResolutionState, reportAmbigousException, out exception);
|
||||
result = LookForTypeInAssemblies(typeName, loadedAssemblies, typeResolutionState, reportAmbiguousException, out exception);
|
||||
if (exception != null)
|
||||
{
|
||||
// skip the rest of lookups, if exception reported.
|
||||
@@ -304,10 +304,10 @@ namespace System.Management.Automation.Language
|
||||
return typeName._typeDefinitionAst.Type;
|
||||
}
|
||||
|
||||
result = ResolveTypeNameWorker(typeName, currentScope, typeResolutionState.assemblies, typeResolutionState, /* reportAmbigousException */ true, out exception);
|
||||
result = ResolveTypeNameWorker(typeName, currentScope, typeResolutionState.assemblies, typeResolutionState, /* reportAmbiguousException */ true, out exception);
|
||||
if (exception == null && result == null)
|
||||
{
|
||||
result = ResolveTypeNameWorker(typeName, currentScope, assemList, typeResolutionState, /* reportAmbigousException */ false, out exception);
|
||||
result = ResolveTypeNameWorker(typeName, currentScope, assemList, typeResolutionState, /* reportAmbiguousException */ false, out exception);
|
||||
}
|
||||
|
||||
if (result != null)
|
||||
@@ -332,10 +332,10 @@ namespace System.Management.Automation.Language
|
||||
assemList = ClrFacade.GetAssemblies(typeResolutionState, newTypeName);
|
||||
}
|
||||
#endif
|
||||
var newResult = ResolveTypeNameWorker(newTypeName, currentScope, typeResolutionState.assemblies, typeResolutionState, /* reportAmbigousException */ true, out exception);
|
||||
var newResult = ResolveTypeNameWorker(newTypeName, currentScope, typeResolutionState.assemblies, typeResolutionState, /* reportAmbiguousException */ true, out exception);
|
||||
if (exception == null && newResult == null)
|
||||
{
|
||||
newResult = ResolveTypeNameWorker(newTypeName, currentScope, assemList, typeResolutionState, /* reportAmbigousException */ false, out exception);
|
||||
newResult = ResolveTypeNameWorker(newTypeName, currentScope, assemList, typeResolutionState, /* reportAmbiguousException */ false, out exception);
|
||||
}
|
||||
|
||||
if (exception != null)
|
||||
|
||||
@@ -11,7 +11,7 @@ using System.Reflection;
|
||||
|
||||
namespace System.Management.Automation.Language
|
||||
{
|
||||
internal static class VariablePathExtentions
|
||||
internal static class VariablePathExtensions
|
||||
{
|
||||
internal static bool IsAnyLocal(this VariablePath variablePath)
|
||||
{
|
||||
|
||||
@@ -9886,7 +9886,7 @@ namespace System.Management.Automation.Language
|
||||
internal StringConstantExpressionAst(StringToken token)
|
||||
: base(token.Extent, token.Value)
|
||||
{
|
||||
this.StringConstantType = MapTokenKindToStringContantKind(token);
|
||||
this.StringConstantType = MapTokenKindToStringConstantKind(token);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -9915,7 +9915,7 @@ namespace System.Management.Automation.Language
|
||||
get { return typeof(string); }
|
||||
}
|
||||
|
||||
internal static StringConstantType MapTokenKindToStringContantKind(Token token)
|
||||
internal static StringConstantType MapTokenKindToStringConstantKind(Token token)
|
||||
{
|
||||
switch (token.Kind)
|
||||
{
|
||||
@@ -10019,7 +10019,7 @@ namespace System.Management.Automation.Language
|
||||
internal ExpandableStringExpressionAst(Token token, string value, string formatString, IEnumerable<ExpressionAst> nestedExpressions)
|
||||
: this(token.Extent, value, formatString,
|
||||
StringConstantExpressionAst
|
||||
.MapTokenKindToStringContantKind(token),
|
||||
.MapTokenKindToStringConstantKind(token),
|
||||
nestedExpressions)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -3513,7 +3513,7 @@ namespace System.Management.Automation.Language
|
||||
{
|
||||
c = GetChar();
|
||||
|
||||
if (c.IsIndentifierFollow())
|
||||
if (c.IsIdentifierFollow())
|
||||
{
|
||||
sb.Append(c);
|
||||
}
|
||||
@@ -3677,7 +3677,7 @@ namespace System.Management.Automation.Language
|
||||
var sb = GetStringBuilder();
|
||||
|
||||
char c = GetChar();
|
||||
if (!c.IsIndentifierStart())
|
||||
if (!c.IsIdentifierStart())
|
||||
{
|
||||
// Must be a generic token then
|
||||
sb.Append(':');
|
||||
@@ -3690,7 +3690,7 @@ namespace System.Management.Automation.Language
|
||||
return ScanGenericToken(sb);
|
||||
}
|
||||
|
||||
while (c.IsIndentifierFollow())
|
||||
while (c.IsIdentifierFollow())
|
||||
{
|
||||
sb.Append(c);
|
||||
c = GetChar();
|
||||
@@ -4057,7 +4057,7 @@ namespace System.Management.Automation.Language
|
||||
case '!':
|
||||
c1 = PeekChar();
|
||||
if ((InCommandMode() && !c1.ForceStartNewToken()) ||
|
||||
(InExpressionMode() && c1.IsIndentifierStart()))
|
||||
(InExpressionMode() && c1.IsIdentifierStart()))
|
||||
{
|
||||
return ScanGenericToken(c);
|
||||
}
|
||||
|
||||
@@ -873,9 +873,9 @@ namespace System.Management.Automation
|
||||
// Check to see expected behavior if one child job fails to start.
|
||||
}
|
||||
|
||||
if (ExcecutionError.Count == 1)
|
||||
if (ExecutionError.Count == 1)
|
||||
{
|
||||
throw ExcecutionError[0];
|
||||
throw ExecutionError[0];
|
||||
} */
|
||||
_tracer.WriteMessage(TraceClassName, "StartJob", Guid.Empty, this, "Exiting method", null);
|
||||
}
|
||||
|
||||
@@ -397,7 +397,7 @@ namespace System.Management.Automation
|
||||
// in the same invocation. Return once the job object is returned and
|
||||
// used to initialize the proxy.
|
||||
DoStartAsync(dataAdded, stateChanged, input);
|
||||
_jobInitialiedWaitHandle.WaitOne();
|
||||
_jobInitializedWaitHandle.WaitOne();
|
||||
}
|
||||
catch (Exception error)
|
||||
{
|
||||
@@ -1344,7 +1344,7 @@ namespace System.Management.Automation
|
||||
// remove it.
|
||||
// Do this within the Try/Finally block so that the wait handle will be set
|
||||
// on exit.
|
||||
_jobInitialiedWaitHandle.WaitOne();
|
||||
_jobInitializedWaitHandle.WaitOne();
|
||||
if (_remoteJobInstanceId == Guid.Empty) return;
|
||||
|
||||
// Stop the receive-job command if it's in progress.
|
||||
@@ -1567,7 +1567,7 @@ namespace System.Management.Automation
|
||||
JobSuspendedOrFinished.Set();
|
||||
OnSuspendJobCompleted(new AsyncCompletedEventArgs(e.JobStateInfo.Reason, false, null));
|
||||
|
||||
_jobInitialiedWaitHandle.Set();
|
||||
_jobInitializedWaitHandle.Set();
|
||||
OnStartJobCompleted(new AsyncCompletedEventArgs(e.JobStateInfo.Reason, false, null));
|
||||
|
||||
OnStopJobCompleted(new AsyncCompletedEventArgs(e.JobStateInfo.Reason, false, null));
|
||||
@@ -2058,7 +2058,7 @@ namespace System.Management.Automation
|
||||
? PSTraceSource.NewNotSupportedException(PowerShellStrings.CommandDoesNotWriteJob)
|
||||
: _receivePowerShell.Streams.Error[0].Exception;
|
||||
DoSetJobState(JobState.Failed, reason);
|
||||
_jobInitialiedWaitHandle.Set();
|
||||
_jobInitializedWaitHandle.Set();
|
||||
OnStartJobCompleted(new AsyncCompletedEventArgs(reason, false, null));
|
||||
return;
|
||||
}
|
||||
@@ -2079,7 +2079,7 @@ namespace System.Management.Automation
|
||||
}
|
||||
|
||||
// Release any thread waiting start.
|
||||
_jobInitialiedWaitHandle.Set();
|
||||
_jobInitializedWaitHandle.Set();
|
||||
_tracer.WriteMessage(ClassNameTrace, "DataAddedToOutput", Guid.Empty, this,
|
||||
"BEGIN Invoke StartJobCompleted event", null);
|
||||
OnStartJobCompleted(new AsyncCompletedEventArgs(null, false, null));
|
||||
@@ -2377,7 +2377,7 @@ namespace System.Management.Automation
|
||||
|
||||
if (_removeComplete != null) _removeComplete.Dispose();
|
||||
if (_jobRunningOrFinished != null) _jobRunningOrFinished.Dispose();
|
||||
_jobInitialiedWaitHandle.Dispose();
|
||||
_jobInitializedWaitHandle.Dispose();
|
||||
if (_jobSuspendedOrFinished != null) _jobSuspendedOrFinished.Dispose();
|
||||
|
||||
if (ChildJobs != null && ChildJobs.Count > 0)
|
||||
@@ -2448,7 +2448,7 @@ namespace System.Management.Automation
|
||||
}
|
||||
}
|
||||
|
||||
private readonly ManualResetEvent _jobInitialiedWaitHandle = new ManualResetEvent(false);
|
||||
private readonly ManualResetEvent _jobInitializedWaitHandle = new ManualResetEvent(false);
|
||||
|
||||
private ManualResetEvent _jobSuspendedOrFinished;
|
||||
private ManualResetEvent JobSuspendedOrFinished
|
||||
|
||||
+1
-1
@@ -179,7 +179,7 @@ namespace System.Management.Automation.Runspaces.Internal
|
||||
new EventHandler<RemoteDataEventArgs<Exception>>(HandleSessionClosing);
|
||||
DataStructureHandler.SessionClosed +=
|
||||
new EventHandler<RemoteDataEventArgs<Exception>>(HandleSessionClosed);
|
||||
DataStructureHandler.SetMaxMinRunspacesResponseRecieved +=
|
||||
DataStructureHandler.SetMaxMinRunspacesResponseReceived +=
|
||||
new EventHandler<RemoteDataEventArgs<PSObject>>(HandleResponseReceived);
|
||||
DataStructureHandler.URIRedirectionReported +=
|
||||
new EventHandler<RemoteDataEventArgs<Uri>>(HandleURIDirectionReported);
|
||||
|
||||
@@ -180,10 +180,10 @@ namespace System.Management.Automation.Internal
|
||||
|
||||
case RemotingDataType.RunspacePoolOperationResponse:
|
||||
{
|
||||
Dbg.Assert(SetMaxMinRunspacesResponseRecieved != null,
|
||||
Dbg.Assert(SetMaxMinRunspacesResponseReceived != null,
|
||||
"RemoteRunspacePoolInternal should subscribe to all data structure handler events");
|
||||
|
||||
SetMaxMinRunspacesResponseRecieved.SafeInvoke(this, new RemoteDataEventArgs<PSObject>(receivedData.Data));
|
||||
SetMaxMinRunspacesResponseReceived.SafeInvoke(this, new RemoteDataEventArgs<PSObject>(receivedData.Data));
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -209,12 +209,12 @@ namespace System.Management.Automation.Internal
|
||||
internal ClientPowerShellDataStructureHandler CreatePowerShellDataStructureHandler(
|
||||
ClientRemotePowerShell shell)
|
||||
{
|
||||
BaseClientCommandTransportManager clientTrsptMgr =
|
||||
BaseClientCommandTransportManager clientTransportMgr =
|
||||
RemoteSession.SessionDataStructureHandler.
|
||||
CreateClientCommandTransportManager(shell, shell.NoInput);
|
||||
|
||||
return new ClientPowerShellDataStructureHandler(
|
||||
clientTrsptMgr, _clientRunspacePoolId, shell.InstanceId);
|
||||
clientTransportMgr, _clientRunspacePoolId, shell.InstanceId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -397,7 +397,7 @@ namespace System.Management.Automation.Internal
|
||||
/// Event raised when a response to a SetMaxRunspaces or SetMinRunspaces call
|
||||
/// is received
|
||||
/// </summary>
|
||||
internal event EventHandler<RemoteDataEventArgs<PSObject>> SetMaxMinRunspacesResponseRecieved;
|
||||
internal event EventHandler<RemoteDataEventArgs<PSObject>> SetMaxMinRunspacesResponseReceived;
|
||||
|
||||
/// <summary>
|
||||
/// EventHandler used to report connection URI redirections to the application
|
||||
|
||||
@@ -118,7 +118,7 @@ namespace System.Management.Automation.Remoting
|
||||
// Fall-back to traditional approach if runspace is not pushed.
|
||||
if (!this.IsRunspaceOverridden)
|
||||
{
|
||||
return CreatePsCommandNotOverriden(line, isScript, useNewScope);
|
||||
return CreatePsCommandNotOverridden(line, isScript, useNewScope);
|
||||
}
|
||||
|
||||
// Try to parse commands as script-block.
|
||||
@@ -127,7 +127,7 @@ namespace System.Management.Automation.Remoting
|
||||
// If that didn't work fall back to traditional approach.
|
||||
if (psCommand == null)
|
||||
{
|
||||
return CreatePsCommandNotOverriden(line, isScript, useNewScope);
|
||||
return CreatePsCommandNotOverridden(line, isScript, useNewScope);
|
||||
}
|
||||
|
||||
// Otherwise return the psCommandCollection we got.
|
||||
@@ -137,7 +137,7 @@ namespace System.Management.Automation.Remoting
|
||||
/// <summary>
|
||||
/// Creates the PSCommand when the runspace is not overridden
|
||||
/// </summary>
|
||||
private PSCommand CreatePsCommandNotOverriden(string line, bool isScript, bool? useNewScope)
|
||||
private PSCommand CreatePsCommandNotOverridden(string line, bool isScript, bool? useNewScope)
|
||||
{
|
||||
PSCommand command = new PSCommand();
|
||||
|
||||
|
||||
@@ -999,13 +999,13 @@ namespace System.Management.Automation
|
||||
private void UpdatePoolDisconnectOptions()
|
||||
{
|
||||
WSManConnectionInfo runspaceWSManConnectionInfo = RunspacePool.ConnectionInfo as WSManConnectionInfo;
|
||||
WSManConnectionInfo wsManconnectionInfo = ConnectionInfo as WSManConnectionInfo;
|
||||
WSManConnectionInfo wsManConnectionInfo = ConnectionInfo as WSManConnectionInfo;
|
||||
|
||||
Dbg.Assert(runspaceWSManConnectionInfo != null, "Disconnect-Connect feature is currently only supported for WSMan transport");
|
||||
Dbg.Assert(wsManconnectionInfo != null, "Disconnect-Connect feature is currently only supported for WSMan transport");
|
||||
Dbg.Assert(wsManConnectionInfo != null, "Disconnect-Connect feature is currently only supported for WSMan transport");
|
||||
|
||||
runspaceWSManConnectionInfo.IdleTimeout = wsManconnectionInfo.IdleTimeout;
|
||||
runspaceWSManConnectionInfo.OutputBufferingMode = wsManconnectionInfo.OutputBufferingMode;
|
||||
runspaceWSManConnectionInfo.IdleTimeout = wsManConnectionInfo.IdleTimeout;
|
||||
runspaceWSManConnectionInfo.OutputBufferingMode = wsManConnectionInfo.OutputBufferingMode;
|
||||
}
|
||||
|
||||
#endregion
|
||||
@@ -2617,7 +2617,7 @@ namespace System.Management.Automation
|
||||
_runspace = runspace;
|
||||
}
|
||||
|
||||
private Exception _isInNoLangugeModeException = null;
|
||||
private Exception _isInNoLanguageModeException = null;
|
||||
private Exception _getVariableCommandNotFoundException = null;
|
||||
private Exception _setVariableCommandNotFoundException = null;
|
||||
|
||||
@@ -2778,8 +2778,8 @@ namespace System.Management.Automation
|
||||
{
|
||||
// Verify the runspace has is not in NoLanguage mode. For performance, throw if we got an error
|
||||
// before.
|
||||
if (_isInNoLangugeModeException != null)
|
||||
throw _isInNoLangugeModeException;
|
||||
if (_isInNoLanguageModeException != null)
|
||||
throw _isInNoLanguageModeException;
|
||||
|
||||
// Since these are implemented as pipelines, we don't need to do our own
|
||||
// locking of sessionStateCallInProgress like we do with local runspaces.
|
||||
@@ -2798,8 +2798,8 @@ namespace System.Management.Automation
|
||||
{
|
||||
if (e.ErrorRecord.CategoryInfo.Category == ErrorCategory.ParserError)
|
||||
{
|
||||
_isInNoLangugeModeException = new PSNotSupportedException(RunspaceStrings.NotSupportedOnRestrictedRunspace, e);
|
||||
throw _isInNoLangugeModeException;
|
||||
_isInNoLanguageModeException = new PSNotSupportedException(RunspaceStrings.NotSupportedOnRestrictedRunspace, e);
|
||||
throw _isInNoLanguageModeException;
|
||||
}
|
||||
else throw;
|
||||
}
|
||||
@@ -2825,8 +2825,8 @@ namespace System.Management.Automation
|
||||
{
|
||||
// Verify the runspace has is not in NoLanguage mode. For performance, throw if we got an error
|
||||
// before.
|
||||
if (_isInNoLangugeModeException != null)
|
||||
throw _isInNoLangugeModeException;
|
||||
if (_isInNoLanguageModeException != null)
|
||||
throw _isInNoLanguageModeException;
|
||||
|
||||
// Since these are implemented as pipelines, we don't need to do our own
|
||||
// locking of sessionStateCallInProgress like we do with local runspaces.
|
||||
@@ -2845,8 +2845,8 @@ namespace System.Management.Automation
|
||||
{
|
||||
if (e.ErrorRecord.CategoryInfo.Category == ErrorCategory.ParserError)
|
||||
{
|
||||
_isInNoLangugeModeException = new PSNotSupportedException(RunspaceStrings.NotSupportedOnRestrictedRunspace, e);
|
||||
throw _isInNoLangugeModeException;
|
||||
_isInNoLanguageModeException = new PSNotSupportedException(RunspaceStrings.NotSupportedOnRestrictedRunspace, e);
|
||||
throw _isInNoLanguageModeException;
|
||||
}
|
||||
else throw;
|
||||
}
|
||||
@@ -2891,7 +2891,7 @@ namespace System.Management.Automation
|
||||
{
|
||||
// Verify the runspace has is not in NoLanguage mode. For performance, return our
|
||||
// cached value if we got an error before.
|
||||
if (_isInNoLangugeModeException != null)
|
||||
if (_isInNoLanguageModeException != null)
|
||||
return PSLanguageMode.NoLanguage;
|
||||
|
||||
// Since these are implemented as pipelines, we don't need to do our own
|
||||
@@ -2909,7 +2909,7 @@ namespace System.Management.Automation
|
||||
{
|
||||
if (e.ErrorRecord.CategoryInfo.Category == ErrorCategory.ParserError)
|
||||
{
|
||||
_isInNoLangugeModeException = new PSNotSupportedException(RunspaceStrings.NotSupportedOnRestrictedRunspace, e);
|
||||
_isInNoLanguageModeException = new PSNotSupportedException(RunspaceStrings.NotSupportedOnRestrictedRunspace, e);
|
||||
return PSLanguageMode.NoLanguage;
|
||||
}
|
||||
else throw;
|
||||
|
||||
@@ -1129,7 +1129,7 @@ namespace Microsoft.PowerShell.Commands
|
||||
int throttleLimit, SessionFilterState filterState,
|
||||
Guid[] matchIds, string[] matchNames, string configurationName)
|
||||
{
|
||||
Collection<PSSession> filteredPSSesions = new Collection<PSSession>();
|
||||
Collection<PSSession> filteredPSSessions = new Collection<PSSession>();
|
||||
|
||||
// Create a query operation for each connection information object.
|
||||
foreach (WSManConnectionInfo connectionInfo in connectionInfos)
|
||||
@@ -1210,25 +1210,25 @@ namespace Microsoft.PowerShell.Commands
|
||||
{
|
||||
if (TestRunspaceState(existingPSSession.Runspace, filterState))
|
||||
{
|
||||
filteredPSSesions.Add(existingPSSession);
|
||||
filteredPSSessions.Add(existingPSSession);
|
||||
}
|
||||
}
|
||||
else if (TestRunspaceState(runspace, filterState))
|
||||
{
|
||||
filteredPSSesions.Add(new PSSession(runspace as RemoteRunspace));
|
||||
filteredPSSessions.Add(new PSSession(runspace as RemoteRunspace));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Return only PSSessions that match provided Ids or Names.
|
||||
if ((matchIds != null) && (filteredPSSesions.Count > 0))
|
||||
if ((matchIds != null) && (filteredPSSessions.Count > 0))
|
||||
{
|
||||
Collection<PSSession> matchIdsSessions = new Collection<PSSession>();
|
||||
foreach (Guid id in matchIds)
|
||||
{
|
||||
bool matchFound = false;
|
||||
foreach (PSSession psSession in filteredPSSesions)
|
||||
foreach (PSSession psSession in filteredPSSessions)
|
||||
{
|
||||
if (_stopProcessing)
|
||||
{
|
||||
@@ -1255,14 +1255,14 @@ namespace Microsoft.PowerShell.Commands
|
||||
// Return all found sessions.
|
||||
return matchIdsSessions;
|
||||
}
|
||||
else if ((matchNames != null) && (filteredPSSesions.Count > 0))
|
||||
else if ((matchNames != null) && (filteredPSSessions.Count > 0))
|
||||
{
|
||||
Collection<PSSession> matchNamesSessions = new Collection<PSSession>();
|
||||
foreach (string name in matchNames)
|
||||
{
|
||||
WildcardPattern namePattern = WildcardPattern.Get(name, WildcardOptions.IgnoreCase);
|
||||
bool matchFound = false;
|
||||
foreach (PSSession psSession in filteredPSSesions)
|
||||
foreach (PSSession psSession in filteredPSSessions)
|
||||
{
|
||||
if (_stopProcessing)
|
||||
{
|
||||
@@ -1290,7 +1290,7 @@ namespace Microsoft.PowerShell.Commands
|
||||
else
|
||||
{
|
||||
// Return all collected sessions.
|
||||
return filteredPSSesions;
|
||||
return filteredPSSessions;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2952,8 +2952,8 @@ Set-SessionPluginQuota $args[0]
|
||||
";
|
||||
|
||||
private const string setSessionConfigurationTimeoutQuotasSbFormat = @"
|
||||
function Set-SessionPluginIdleTimeoutQuotas([int] $maxIdleTimeoutms, [int] $idleTimeoutms, [bool] $setMaxIdleTimoutFirst) {{
|
||||
if ($setMaxIdleTimoutFirst) {{
|
||||
function Set-SessionPluginIdleTimeoutQuotas([int] $maxIdleTimeoutms, [int] $idleTimeoutms, [bool] $setMaxIdleTimeoutFirst) {{
|
||||
if ($setMaxIdleTimeoutFirst) {{
|
||||
set-item -WarningAction SilentlyContinue 'WSMan:\localhost\Plugin\{0}\Quotas\MaxIdleTimeoutms' -Value $maxIdleTimeoutms -confirm:$false
|
||||
set-item -WarningAction SilentlyContinue 'WSMan:\localhost\Plugin\{0}\Quotas\IdleTimeoutms' -Value $idleTimeoutms -confirm:$false
|
||||
}}
|
||||
@@ -3571,7 +3571,7 @@ Set-PSSessionConfiguration $args[0] $args[1] $args[2] $args[3] $args[4] $args[5]
|
||||
|
||||
if (idleTimeOut != 0 && quotas.ContainsKey(WSManConfigurationOption.AttribMaxIdleTimeout))
|
||||
{
|
||||
bool setMaxIdleTimoutFirst = true;
|
||||
bool setMaxIdleTimeoutFirst = true;
|
||||
int maxIdleTimeOut;
|
||||
|
||||
if (LanguagePrimitives.TryConvertTo<int>(quotas[WSManConfigurationOption.AttribMaxIdleTimeout], out maxIdleTimeOut))
|
||||
@@ -3594,7 +3594,7 @@ Set-PSSessionConfiguration $args[0] $args[1] $args[2] $args[3] $args[4] $args[5]
|
||||
|
||||
if (currentIdleTimeoutms >= maxIdleTimeOut && currentIdleTimeoutms >= idleTimeOut)
|
||||
{
|
||||
setMaxIdleTimoutFirst = false;
|
||||
setMaxIdleTimeoutFirst = false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3609,7 +3609,7 @@ Set-PSSessionConfiguration $args[0] $args[1] $args[2] $args[3] $args[4] $args[5]
|
||||
dollarUnder: AutomationNull.Value,
|
||||
input: Utils.EmptyArray<object>(),
|
||||
scriptThis: AutomationNull.Value,
|
||||
args: new object[] { maxIdleTimeOut, idleTimeOut, setMaxIdleTimoutFirst });
|
||||
args: new object[] { maxIdleTimeOut, idleTimeOut, setMaxIdleTimeoutFirst });
|
||||
|
||||
// Remove Idle timeout values as we have set them above
|
||||
//
|
||||
@@ -4410,7 +4410,7 @@ $_ | Enable-PSSessionConfiguration -force $args[0] -sddl $args[1] -isSDDLSpecifi
|
||||
|
||||
string qcCaptionMessage = StringUtil.Format(RemotingErrorIdStrings.EcsWSManQCCaption);
|
||||
string qcQueryMessage = StringUtil.Format(RemotingErrorIdStrings.EcsWSManQCQuery, setWSManConfigCommand);
|
||||
string qcShoudProcessDesc = StringUtil.Format(RemotingErrorIdStrings.EcsWSManShouldProcessDesc, setWSManConfigCommand);
|
||||
string qcShouldProcessDesc = StringUtil.Format(RemotingErrorIdStrings.EcsWSManShouldProcessDesc, setWSManConfigCommand);
|
||||
string setCaptionMessage = StringUtil.Format(RemotingErrorIdStrings.CSShouldProcessAction,
|
||||
"Set-PSSessionConfiguration");
|
||||
string setQueryMessage = RemotingErrorIdStrings.EcsShouldProcessTarget;
|
||||
@@ -4434,7 +4434,7 @@ $_ | Enable-PSSessionConfiguration -force $args[0] -sddl $args[1] -isSDDLSpecifi
|
||||
qcCaptionMessage,
|
||||
whatIf,
|
||||
confirm,
|
||||
qcShoudProcessDesc,
|
||||
qcShouldProcessDesc,
|
||||
setEnabledTarget,
|
||||
setEnabledAction,
|
||||
_skipNetworkProfileCheck,
|
||||
|
||||
+3
-3
@@ -1915,7 +1915,7 @@ namespace Microsoft.PowerShell.Commands
|
||||
{
|
||||
for (int i = 0; i < values.Length;)
|
||||
{
|
||||
WriteRequriedGroup(values[i++], sb);
|
||||
WriteRequiredGroup(values[i++], sb);
|
||||
|
||||
if (i < values.Length)
|
||||
{
|
||||
@@ -1925,7 +1925,7 @@ namespace Microsoft.PowerShell.Commands
|
||||
}
|
||||
else
|
||||
{
|
||||
WriteRequriedGroup(keyObject, sb);
|
||||
WriteRequiredGroup(keyObject, sb);
|
||||
}
|
||||
|
||||
sb.Append(" }");
|
||||
@@ -1933,7 +1933,7 @@ namespace Microsoft.PowerShell.Commands
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
private static void WriteRequriedGroup(object value, StringBuilder sb)
|
||||
private static void WriteRequiredGroup(object value, StringBuilder sb)
|
||||
{
|
||||
string strValue = value as string;
|
||||
if (strValue != null)
|
||||
|
||||
@@ -93,7 +93,7 @@ namespace Microsoft.PowerShell.Commands
|
||||
}
|
||||
}
|
||||
|
||||
private void InvokeEndProcesingAction()
|
||||
private void InvokeEndProcessingAction()
|
||||
{
|
||||
_endProcessingActionIsReady.Wait();
|
||||
|
||||
@@ -270,7 +270,7 @@ namespace Microsoft.PowerShell.Commands
|
||||
}
|
||||
}
|
||||
|
||||
private void CleanUpTimoutTracking()
|
||||
private void CleanUpTimeoutTracking()
|
||||
{
|
||||
lock (_timerLock)
|
||||
{
|
||||
@@ -346,7 +346,7 @@ namespace Microsoft.PowerShell.Commands
|
||||
protected override void EndProcessing()
|
||||
{
|
||||
this.StartJobChangesTracking();
|
||||
this.InvokeEndProcesingAction();
|
||||
this.InvokeEndProcessingAction();
|
||||
if (_warnNotTerminal)
|
||||
{
|
||||
WriteWarning(RemotingErrorIdStrings.JobSuspendedDisconnectedWaitWithForce);
|
||||
@@ -420,7 +420,7 @@ namespace Microsoft.PowerShell.Commands
|
||||
{
|
||||
_isDisposed = true;
|
||||
|
||||
this.CleanUpTimoutTracking();
|
||||
this.CleanUpTimeoutTracking();
|
||||
this.CleanUpJobChangesTracking();
|
||||
this.CleanUpEndProcessing(); // <- has to be last
|
||||
}
|
||||
|
||||
@@ -487,9 +487,9 @@ namespace Microsoft.PowerShell.Commands
|
||||
}
|
||||
|
||||
// add host identification information in data structure handler message
|
||||
PSRemotingDataStructureException protoExeption = reason as PSRemotingDataStructureException;
|
||||
PSRemotingDataStructureException protoException = reason as PSRemotingDataStructureException;
|
||||
|
||||
if (protoExeption != null)
|
||||
if (protoException != null)
|
||||
{
|
||||
OpenRunspaceOperation senderAsOp = sender as OpenRunspaceOperation;
|
||||
|
||||
@@ -497,7 +497,7 @@ namespace Microsoft.PowerShell.Commands
|
||||
{
|
||||
String host = senderAsOp.OperatedRunspace.ConnectionInfo.ComputerName;
|
||||
|
||||
errorDetails = "[" + host + "] " + protoExeption.Message;
|
||||
errorDetails = "[" + host + "] " + protoException.Message;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loaded 100 of 134 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user