We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1c5ebde commit cfa7d5cCopy full SHA for cfa7d5c
1 file changed
build/Build-MaesterModule.ps1
@@ -68,6 +68,10 @@ if ($ResolvedOutput -ieq $DriveRoot) {
68
if ($ResolvedOutput -ieq $RepoRoot.TrimEnd('\', '/')) {
69
throw "Refusing to use OutputRoot '$OutputRoot' because it resolves to the repository root: '$RepoRoot'."
70
}
71
+$RepoPath = $RepoRoot.TrimEnd('\', '/')
72
+if (-not $ResolvedOutput.StartsWith($RepoPath + [System.IO.Path]::DirectorySeparatorChar, [System.StringComparison]::OrdinalIgnoreCase)) {
73
+ throw "Refusing to use OutputRoot '$OutputRoot' because it is outside the repository root '$RepoRoot'."
74
+}
75
76
if (Test-Path -LiteralPath $OutputRoot) {
77
Remove-Item -LiteralPath $OutputRoot -Recurse -Force
0 commit comments