#Add Sandcastle tools to the Path $path = "$env:programfiles\Sandcastle" #compile a Sandcastle example pushd "$path\Examples\Sandcastle" $compiler = "$env:windir/Microsoft.NET/Framework/v2.0.50727/csc" &$compiler /t:library /doc:comments.xml test.cs #variables you care about $dllsToGenFrom = "test.dll" $outputHHC = "test.hhc" #this is where the Sandcastle-y stuff starts...test.dll is the input output. #If this were a more generic "build-help.ps1" script, $dllsToGenFrom would come from $args $prodTools = "$path\ProductionTools" $oldPath = get-content Env:\Path if ($oldPath.Contains("sandcastle") -eq $false) { $newPath = $oldPath + ";" + $prodTools set-content Env:\Path $newPath } MRefBuilder $dllsToGenFrom /out:reflection.org XslTransform "$path\ProductionTransforms\AddOverloads.xsl" reflection.org | XslTransform "$path\ProductionTransforms\AddGuidFilenames.xsl" /out:reflection.xml XslTransform "$path\ProductionTransforms\ReflectionToManifest.xsl" reflection.xml /out:manifest.xml #PS1 version of CopyOutput.bat if ((test-path Output) -eq $false) { mkdir Output } if ((test-path Output\html) -eq $false) { mkdir Output\html } if ((test-path Output\art) -eq $false) { mkdir Output\art } if ((test-path Output\scripts) -eq $false) { mkdir Output\scripts } if ((test-path Output\styles) -eq $false) { mkdir Output\styles } copy "$path\Presentation\art\*" Output\art copy "$path\Presentation\scripts\*" Output\scripts copy "$path\Presentation\styles\*" Output\styles copy "$path\Presentation\Configuration\Sandcastle.config" . BuildAssembler /config:sandcastle.config manifest.xml XslTransform ..\..\ProductionTransforms\ReflectionToChmContents.xsl reflection.xml /arg:html=Output\html /out:$outputHHC move $outputHHC Output -force copy "$path\Presentation\Chm\*" Output & "$env:programfiles\HTML Help Workshop\hhc.exe" Output\test.hhp popd