ProjectOS / scripts /validate-manifest.ps1
AnthropicallyHuggingFaces's picture
Sync full ProjectOS monorepo from GitHub 7f633f5 (part 2)
d821d28 verified
Raw History Blame Contribute Delete
784 Bytes
param(
[string]$ProjectRoot = (Join-Path $PSScriptRoot '..'),
[string]$ManifestPath = (Join-Path $ProjectRoot 'bootstrap.xml'),
[string]$SchemaPath = (Join-Path $ProjectRoot 'schemas/ProjectOS.xsd')
)
$ErrorActionPreference = 'Stop'
$schemaPath = (Resolve-Path $SchemaPath).Path
$manifestPath = (Resolve-Path $ManifestPath).Path
$schemas = [System.Xml.Schema.XmlSchemaSet]::new()
[void]$schemas.Add($null, $schemaPath)
$settings = [System.Xml.XmlReaderSettings]::new()
$settings.ValidationType = [System.Xml.ValidationType]::Schema
$settings.Schemas = $schemas
$reader = [System.Xml.XmlReader]::Create($manifestPath, $settings)
try {
while ($reader.Read()) { }
}
finally {
$reader.Close()
}
Write-Output 'bootstrap.xml validates against schemas/ProjectOS.xsd.'