diff --git a/.build/Build.ps1 b/.build/Build.ps1 index 307bbe6aae..16829cd44c 100644 --- a/.build/Build.ps1 +++ b/.build/Build.ps1 @@ -53,7 +53,7 @@ $allScriptFiles = Get-ChildItem -Path $repoRoot -Directory | ForEach-Object { $_.FullName } <# - Build the table of depedencies, and a separate table of commit times. + Build the table of dependencies, and a separate table of commit times. #> $dependencyHashtable = Get-ScriptDependencyHashtable -FileNames $allScriptFiles diff --git a/.build/BuildFunctions/Get-DotSourcedScriptName.ps1 b/.build/BuildFunctions/Get-DotSourcedScriptName.ps1 index 4ccaabb577..e80cf81d7d 100644 --- a/.build/BuildFunctions/Get-DotSourcedScriptName.ps1 +++ b/.build/BuildFunctions/Get-DotSourcedScriptName.ps1 @@ -17,8 +17,8 @@ function Get-DotSourcedScriptName { process { $m = $Line | Select-String "\. (?:\.|\`$PSScriptRoot)\\(.*).ps1" if ($null -ne $m) { - $dotloadedScriptPath = $m.Matches[0].Groups[1].Value + ".ps1" - $dotloadedScriptPath + $dotLoadedScriptPath = $m.Matches[0].Groups[1].Value + ".ps1" + $dotLoadedScriptPath } } } diff --git a/.build/BuildFunctions/Get-ScriptDependencyHashtable.ps1 b/.build/BuildFunctions/Get-ScriptDependencyHashtable.ps1 index 31c9008369..f90169fa42 100644 --- a/.build/BuildFunctions/Get-ScriptDependencyHashtable.ps1 +++ b/.build/BuildFunctions/Get-ScriptDependencyHashtable.ps1 @@ -24,8 +24,8 @@ function Get-ScriptDependencyHashtable { if ($currentFile.EndsWith(".ps1")) { Select-String "\. (?:\.|\`$PSScriptRoot)\\(.*).ps1" $currentFile | ForEach-Object { - $dotloadedScriptPath = $_.Matches[0].Groups[1].Value + ".ps1" - $dotSourcedFile = (Get-Item (Join-Path $currentFolder $dotloadedScriptPath)).FullName + $dotLoadedScriptPath = $_.Matches[0].Groups[1].Value + ".ps1" + $dotSourcedFile = (Get-Item (Join-Path $currentFolder $dotLoadedScriptPath)).FullName $deps[$currentFile] += $dotSourcedFile if ($null -eq $deps[$dotSourcedFile]) { $stack.Push($dotSourcedFile) diff --git a/.build/CodeFormatter.ps1 b/.build/CodeFormatter.ps1 index 9cb85b1968..99973fd965 100644 --- a/.build/CodeFormatter.ps1 +++ b/.build/CodeFormatter.ps1 @@ -105,7 +105,7 @@ foreach ($fileInfo in $filesToCheck) { } break } catch { - Write-Warning "Invoke-ScriptAnalyer failed on $($fileInfo.FullName). Error:" + Write-Warning "Invoke-ScriptAnalyzer failed on $($fileInfo.FullName). Error:" $_.Exception | Format-List | Out-Host Write-Warning "Retrying in 5 seconds." Start-Sleep -Seconds 5 diff --git a/.build/CodeFormatterChecks/CheckScriptFileHasBOM.ps1 b/.build/CodeFormatterChecks/CheckScriptFileHasBOM.ps1 index 984c4f03b7..9843c543b2 100644 --- a/.build/CodeFormatterChecks/CheckScriptFileHasBOM.ps1 +++ b/.build/CodeFormatterChecks/CheckScriptFileHasBOM.ps1 @@ -19,9 +19,9 @@ function CheckScriptFileHasBOM { https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_character_encoding - "If you need to use non-Ascii characters in your scripts, save them as UTF-8 with BOM. + "If you need to use non-ASCII characters in your scripts, save them as UTF-8 with BOM. Without the BOM, Windows PowerShell misinterprets your script as being encoded in the - legacy "ANSI" codepage. Conversely, files that do have the UTF-8 BOM can be problematic + legacy "ANSI" CodePage. Conversely, files that do have the UTF-8 BOM can be problematic on Unix-like platforms." Since these scripts are purely for Exchange and Exchange Online, we expect they will usually diff --git a/.build/Docs.ps1 b/.build/Docs.ps1 index 19555a5200..899e4b183e 100644 --- a/.build/Docs.ps1 +++ b/.build/Docs.ps1 @@ -3,6 +3,7 @@ $repoRoot = Get-Item "$PSScriptRoot\.." $docsDir = "$repoRoot\docs" +#cspell:words mkdocs $markDownFiles = Get-Content "$repoRoot\mkdocs.yml" | Select-String "(\S+\.md)" | ForEach-Object { $_.Matches.Groups[1].Value } diff --git a/.build/HelpFunctions/Get-CommitFilesOnBranch.ps1 b/.build/HelpFunctions/Get-CommitFilesOnBranch.ps1 index 48b1d419aa..70e473ff8d 100644 --- a/.build/HelpFunctions/Get-CommitFilesOnBranch.ps1 +++ b/.build/HelpFunctions/Get-CommitFilesOnBranch.ps1 @@ -14,8 +14,8 @@ function Get-CommitFilesOnBranch { Write-Verbose "Checking commits only" # Get all the commits between origin/$Branch and HEAD. - $gitlog = git log --format="%H %cd" --date=rfc origin/$Branch..HEAD - $m = $gitlog | Select-String "^(\S+) (.*)$" + $gitLog = git log --format="%H %cd" --date=rfc origin/$Branch..HEAD + $m = $gitLog | Select-String "^(\S+) (.*)$" foreach ($commitMatch in $m) { $commitHash = $commitMatch.Matches.Groups[1].Value diff --git a/.build/SpellCheck.ps1 b/.build/SpellCheck.ps1 index 4ab0a9155a..879e4fc850 100644 --- a/.build/SpellCheck.ps1 +++ b/.build/SpellCheck.ps1 @@ -36,7 +36,7 @@ function DoSpellCheck { $repoRoot = [IO.Path]::GetFullPath((Join-Path $PSScriptRoot "..")) - cspell lint --config "$PSScriptRoot\cspell.json" --no-progress (Join-Path $repoRoot "**" "*.md") (Join-Path $repoRoot "**" "*.ps1") + cspell lint --dot --config "$PSScriptRoot\cspell.json" --no-progress (Join-Path $repoRoot "**" "*.md") (Join-Path $repoRoot "**" "*.ps1") } DoSpellCheck diff --git a/.build/ValidateMerge.ps1 b/.build/ValidateMerge.ps1 index facfa5f7fa..f446ffd19b 100644 --- a/.build/ValidateMerge.ps1 +++ b/.build/ValidateMerge.ps1 @@ -44,8 +44,8 @@ $allowMergeFiles = @() $filesAlreadyChecked = New-Object 'System.Collections.Generic.HashSet[string]' # Get all the commits between origin/$Branch and HEAD. -$gitlog = git log --format="%H %cd" --date=rfc origin/$Branch..HEAD -$m = $gitlog | Select-String "^(\S+) (.*)$" +$gitLog = git log --format="%H %cd" --date=rfc origin/$Branch..HEAD +$m = $gitLog | Select-String "^(\S+) (.*)$" foreach ($commitMatch in $m) { $commitHash = $commitMatch.Matches.Groups[1].Value @@ -77,11 +77,11 @@ foreach ($commitMatch in $m) { $topLevelDependents = New-Object 'System.Collections.Generic.HashSet[string]' while ($stack.Count -gt 0) { $currentFile = $stack.Pop() - $depdendents = $dependentsTable[$currentFile] - if ($null -eq $depdendents -or $depdendents.Count -eq 0) { + $dependents = $dependentsTable[$currentFile] + if ($null -eq $dependents -or $dependents.Count -eq 0) { [void]$topLevelDependents.Add($currentFile) } else { - foreach ($dependent in $depdendents) { + foreach ($dependent in $dependents) { [void]$stack.Push($dependent) } } diff --git a/Diagnostics/HealthChecker/Analyzer/Invoke-AnalyzerExchangeInformation.ps1 b/Diagnostics/HealthChecker/Analyzer/Invoke-AnalyzerExchangeInformation.ps1 index 49cc2b6a28..b5cd8348de 100644 --- a/Diagnostics/HealthChecker/Analyzer/Invoke-AnalyzerExchangeInformation.ps1 +++ b/Diagnostics/HealthChecker/Analyzer/Invoke-AnalyzerExchangeInformation.ps1 @@ -84,6 +84,7 @@ function Invoke-AnalyzerExchangeInformation { } $extendedSupportDate = $exchangeInformation.BuildInformation.VersionInformation.ExtendedSupportDate + $exchangeFriendlyName = $exchangeInformation.BuildInformation.VersionInformation.FriendlyName if ($extendedSupportDate -le ([DateTime]::Now.AddYears(1))) { $displayWriteType = "Yellow" @@ -91,8 +92,12 @@ function Invoke-AnalyzerExchangeInformation { $displayWriteType = "Red" } - $displayValue = "$($exchangeInformation.BuildInformation.VersionInformation.ExtendedSupportDate.ToString("MMM dd, yyyy", - [System.Globalization.CultureInfo]::CreateSpecificCulture("en-US"))) - Please note of the End Of Life date and plan to migrate soon." + if (($exchangeFriendlyName -match '2010|2013|2016|2019')) { + $displayValue = "$($exchangeInformation.BuildInformation.VersionInformation.ExtendedSupportDate.ToString("MMM dd, yyyy", + [System.Globalization.CultureInfo]::CreateSpecificCulture("en-US"))) - Please note the End Of Life date. Reference our blog for more information: https://aka.ms/HC-UpgradeToSE" + } else { + $displayValue = "Please note the End Of Life date and plan your migration accordingly." + } if ($extendedSupportDate -le ([DateTime]::Now)) { $displayValue = "Error: Your Exchange server reached end of life on " + @@ -146,7 +151,7 @@ function Invoke-AnalyzerExchangeInformation { foreach ($kbInfo in $exchangeInformation.BuildInformation.KBsInstalledInfo) { $kbName = $kbInfo.PackageName $params = $baseParams + @{ - Details = "$kbName - Installed on $($kbInfo.InstalledDate)" + Details = "$kbName" DisplayCustomTabNumber = 2 TestingName = "Exchange IU" } diff --git a/Setup/.NotPublished/ScrubSetupLog.NotPublished.ps1 b/Setup/.NotPublished/ScrubSetupLog.NotPublished.ps1 index 8ce972aca3..330f71c5ac 100644 --- a/Setup/.NotPublished/ScrubSetupLog.NotPublished.ps1 +++ b/Setup/.NotPublished/ScrubSetupLog.NotPublished.ps1 @@ -132,7 +132,7 @@ function ScrubValuesAndReplace { $Script:logContent = $newContent } -$scrubToDomainPossibleName = "Rey.Ben.Skywalker.Child.Solo.local" +$scrubToDomainPossibleName = "Rey.Ben.SkyWalker.Child.Solo.local" #Scrub the data $loggedOnUserSls = $logContent | Select-String "Logged on user: (.+)." @@ -196,7 +196,7 @@ $orgContainerMatch = $orgContainerSls.Line.Substring($index, $orgContainerSls.Li $orgContainer = $orgContainerMatch.Replace($orgContainerSls.Matches.Groups[1].Value, "SoloORG") ScrubValuesAndReplace -Match $orgContainerMatch -Replace $orgContainer -ScrubValuesAndReplace -Match $orgContainersls.Matches.Groups[1].Value -Replace "SoloORG" +ScrubValuesAndReplace -Match $orgContainerSls.Matches.Groups[1].Value -Replace "SoloORG" $serverFQDNSls = $logContent | Select-String "Evaluated \[Setting:ComputerNameDnsFullyQualified\].+\[Value:`"(.+)`"\] \[ParentValue:" $i = 1