3535. PARAMETER TestsOnly
3636 Run only Phase 1 (Pester tests) without running the utilities.
3737
38- . PARAMETER SkipLinkCheck
38+ . PARAMETER SkipInternalLinksCheck
39+ Skip internal link checking in Phase 2. Useful for quick iterations.
40+
41+ . PARAMETER SkipExternalLinksCheck
3942 Skip external link checking in Phase 2 (internal links are still checked). Useful for quick iterations.
4043 Mutually exclusive with -NoCache.
4144
4245. PARAMETER NoCache
4346 Force fresh external link checks by bypassing the cache. Passes -NoCache to check-links.ps1.
44- Mutually exclusive with -SkipLinkCheck .
47+ Mutually exclusive with -SkipExternalLinksCheck .
4548
4649. EXAMPLE
4750 .\run-utils.ps1
5659 Skips tests and runs utilities directly.
5760
5861. EXAMPLE
59- .\run-utils.ps1 -SkipLinkCheck
62+ .\run-utils.ps1 -SkipExternalLinksCheck
6063 Runs tests and utilities, but skips external link checking (internal links still checked).
6164
65+ . EXAMPLE
66+ .\run-utils.ps1 -SkipInternalLinksCheck
67+ Runs tests and utilities, but skips internal link checking (external links still checked).
68+
6269. EXAMPLE
6370 .\run-utils.ps1 -NoCache
6471 Runs tests and utilities, forcing fresh external link checks (bypasses cache).
6774param (
6875 [switch ]$SkipTests ,
6976 [switch ]$TestsOnly ,
70- [switch ]$SkipLinkCheck ,
77+ [switch ]$SkipInternalLinksCheck ,
78+ [switch ]$SkipExternalLinksCheck ,
7179 [switch ]$NoCache
7280)
7381
7482# Validate mutually exclusive parameters
75- if ($SkipLinkCheck -and $NoCache ) {
76- Write-Host " ERROR: -SkipLinkCheck and -NoCache cannot be used together." - ForegroundColor Red
77- Write-Host " -SkipLinkCheck : Skips external link checking entirely (only internal links checked) " - ForegroundColor Yellow
83+ if ($SkipExternalLinksCheck -and $NoCache ) {
84+ Write-Host " ERROR: -SkipExternalLinksCheck and -NoCache cannot be used together." - ForegroundColor Red
85+ Write-Host " -SkipExternalLinksCheck : Skips external link checking entirely" - ForegroundColor Yellow
7886 Write-Host " -NoCache: Forces fresh external link checks (bypasses cache)" - ForegroundColor Yellow
7987 exit 1
8088}
@@ -368,9 +376,12 @@ if (-not $TestsOnly) {
368376
369377 # 3. Check links
370378 $linkCheckScript = Join-Path $utilPath " check-links.ps1"
371- if ($SkipLinkCheck ) {
372- # Only check internal links when -SkipLinkCheck is used
373- Write-Host " Step 3/3: Checking internal links only (-SkipLinkCheck)" - ForegroundColor Cyan
379+ if ($SkipInternalLinksCheck -and $SkipExternalLinksCheck ) {
380+ # Skip link checking entirely
381+ Write-Host " Step 3/3: Skipping link check (-SkipInternalLinksCheck -SkipExternalLinksCheck)" - ForegroundColor Yellow
382+ } elseif ($SkipExternalLinksCheck ) {
383+ # Only check internal links when -SkipExternalLinksCheck is used
384+ Write-Host " Step 3/3: Checking internal links only (-SkipExternalLinksCheck)" - ForegroundColor Cyan
374385 Write-Host " "
375386 & $linkCheckScript - internal
376387 if ($LASTEXITCODE -ne 0 ) {
@@ -379,6 +390,23 @@ if (-not $TestsOnly) {
379390 Write-Host " PHASE 2 FAILED at Step 3" - ForegroundColor Red
380391 exit 1
381392 }
393+ } elseif ($SkipInternalLinksCheck ) {
394+ # Only check external links when -SkipInternalLinksCheck is used
395+ if ($NoCache ) {
396+ Write-Host " Step 3/3: Checking external links only (-SkipInternalLinksCheck -NoCache)" - ForegroundColor Cyan
397+ Write-Host " "
398+ & $linkCheckScript - external - NoCache
399+ } else {
400+ Write-Host " Step 3/3: Checking external links only (-SkipInternalLinksCheck)" - ForegroundColor Cyan
401+ Write-Host " "
402+ & $linkCheckScript - external
403+ }
404+ if ($LASTEXITCODE -ne 0 ) {
405+ Write-Host " "
406+ Write-Host " ==========================================="
407+ Write-Host " PHASE 2 FAILED at Step 3" - ForegroundColor Red
408+ exit 1
409+ }
382410 } elseif ($NoCache ) {
383411 # Check all links with fresh cache
384412 Write-Host " Step 3/3: Checking all links (-NoCache)" - ForegroundColor Cyan
0 commit comments