<# .SYNOPSIS 验证混淆发布包不会泄露 Flyshot 源码文档或调试符号。 .PARAMETER PublishDirectory 需要检查的框架依赖混淆发布目录。 #> [CmdletBinding()] param( [string]$PublishDirectory = (Join-Path $PSScriptRoot '..\..\outputs\obfuscated\framework-dependent') ) $ErrorActionPreference = 'Stop' $absolutePublishDirectory = [System.IO.Path]::GetFullPath($PublishDirectory) if (-not (Test-Path -LiteralPath $absolutePublishDirectory -PathType Container)) { throw "混淆发布目录不存在:$absolutePublishDirectory" } $sensitiveFiles = @( Get-ChildItem -LiteralPath $absolutePublishDirectory -File | Where-Object { $_.Name -like 'Flyshot*.xml' -or $_.Name -like 'Flyshot*.pdb' } ) if ($sensitiveFiles.Count -gt 0) { throw "混淆发布包仍包含源码文档或调试符号:$($sensitiveFiles.Name -join ', ')" } Write-Host 'Test-PublishedArtifactPrivacy.ps1: PASS'