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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -613,7 +613,7 @@ private void ProcessListLog()
foreach (string logName in eventLogSession.GetLogNames())
{
if (((!WildcardPattern.ContainsWildcardCharacters(logPattern))
&& string.Equals(logPattern, logName, StringComparison.CurrentCultureIgnoreCase))
&& string.Equals(logPattern, logName, StringComparison.OrdinalIgnoreCase))
||
(wildLogPattern.IsMatch(logName)))
{
Expand Down Expand Up @@ -683,7 +683,7 @@ private void ProcessListProvider()
foreach (string provName in eventLogSession.GetProviderNames())
{
if (((!WildcardPattern.ContainsWildcardCharacters(provPattern))
&& string.Equals(provPattern, provName, StringComparison.CurrentCultureIgnoreCase))
&& string.Equals(provPattern, provName, StringComparison.OrdinalIgnoreCase))
||
(wildProvPattern.IsMatch(provName)))
{
Expand Down Expand Up @@ -2070,7 +2070,7 @@ private void FindLogNamesMatchingWildcards(EventLogSession eventLogSession, IEnu
foreach (string actualLogName in eventLogSession.GetLogNames())
{
if (((!WildcardPattern.ContainsWildcardCharacters(logPattern))
&& (logPattern.Equals(actualLogName, StringComparison.CurrentCultureIgnoreCase)))
&& (logPattern.Equals(actualLogName, StringComparison.OrdinalIgnoreCase)))
||
(wildLogPattern.IsMatch(actualLogName)))
{
Expand Down Expand Up @@ -2139,7 +2139,7 @@ private void FindProvidersByLogForWildcardPatterns(EventLogSession eventLogSessi
foreach (string provName in eventLogSession.GetProviderNames())
{
if (((!WildcardPattern.ContainsWildcardCharacters(provPattern))
&& (provPattern.Equals(provName, StringComparison.CurrentCultureIgnoreCase)))
&& (provPattern.Equals(provName, StringComparison.OrdinalIgnoreCase)))
||
(wildProvPattern.IsMatch(provName)))
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ private static PSObject PopulateFromJDictionary(JObject entries, DuplicateMember
// Case sensitive duplicates should normally not occur since JsonConvert.DeserializeObject
// does not throw when encountering duplicates and just uses the last entry.
if (memberHashTracker.TryGetValue(entry.Key, out var maybePropertyName)
&& string.Compare(entry.Key, maybePropertyName, StringComparison.CurrentCulture) == 0)
&& string.Compare(entry.Key, maybePropertyName, StringComparison.Ordinal) == 0)
{
var errorMsg = string.Format(CultureInfo.CurrentCulture, WebCmdletStrings.DuplicateKeysInJsonString, entry.Key);
error = new ErrorRecord(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1180,7 +1180,7 @@ private string RelativePath(string directory)
string relPath = _path;
if (!relPath.Equals(inputStream))
{
if (relPath.StartsWith(directory, StringComparison.CurrentCultureIgnoreCase))
if (relPath.StartsWith(directory, StringComparison.OrdinalIgnoreCase))
{
int offset = directory.Length;
if (offset < relPath.Length)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ internal void NewDrive(PSDriveInfo drive, string scopeID, CmdletProviderContext
return;
}

if (string.Compare(result.Name, drive.Name, StringComparison.CurrentCultureIgnoreCase) == 0)
if (string.Compare(result.Name, drive.Name, StringComparison.OrdinalIgnoreCase) == 0)
{
// Set the drive in the current scope.

Expand Down Expand Up @@ -1295,7 +1295,7 @@ private bool CanRemoveDrive(PSDriveInfo drive, CmdletProviderContext context)
// Make sure the provider didn't try to pull a fast one on us
// and substitute a different drive.

if (string.Compare(result.Name, drive.Name, StringComparison.CurrentCultureIgnoreCase) == 0)
if (string.Compare(result.Name, drive.Name, StringComparison.OrdinalIgnoreCase) == 0)
{
driveRemovable = true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -733,7 +733,7 @@ CmdletProviderContext normalizePathContext
providerSpecificPath,
currentWorkingPath);

if (string.Compare(providerSpecificPath, currentWorkingPath, StringComparison.CurrentCultureIgnoreCase) == 0)
if (string.Compare(providerSpecificPath, currentWorkingPath, StringComparison.OrdinalIgnoreCase) == 0)
{
// The path is the current working directory so
// return true
Expand Down Expand Up @@ -765,7 +765,7 @@ CmdletProviderContext normalizePathContext
lockedDirectory,
providerSpecificPath);

if (string.Compare(lockedDirectory, providerSpecificPath, StringComparison.CurrentCultureIgnoreCase) == 0)
if (string.Compare(lockedDirectory, providerSpecificPath, StringComparison.OrdinalIgnoreCase) == 0)
{
// The path is a parent of the current working
// directory
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1204,7 +1204,7 @@ private HistoryInfo GetHistoryEntryToInvoke(History history)
// and search backwards through the entries
for (int i = entries.Length - 1; i >= 0; i--)
{
if (entries[i].CommandLine.StartsWith(_commandLine, StringComparison.CurrentCulture))
if (entries[i].CommandLine.StartsWith(_commandLine, StringComparison.Ordinal))
{
entry = entries[i];
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5047,7 +5047,7 @@ protected override string NormalizeRelativePath(
{
// Add the base path back on so that it can be used for
// processing
if (!result.StartsWith(basePath, StringComparison.CurrentCulture))
if (!result.StartsWith(basePath, StringComparison.Ordinal))
{
result = MakePath(basePath, result);
}
Expand Down Expand Up @@ -5111,7 +5111,7 @@ protected override string NormalizeRelativePath(
result = files.First();
#endif

if (result.StartsWith(basePath, StringComparison.CurrentCulture))
if (result.StartsWith(basePath, StringComparison.Ordinal))
{
result = result.Substring(basePath.Length);
}
Expand Down