99 [switch ] $NoOpen = $False
1010)
1111
12+ # workaround for bug at https://github.com/PowerShell/PowerShell/issues/23875#issuecomment-2672336383
13+ $PSDefaultParameterValues [' Remove-Item:ProgressAction' ] = ' SilentlyContinue'
14+
1215function VerifySuccessExitCode {
1316 if ($LastExitCode -ne 0 ) {
1417 throw " Command failed with exit code $LastExitCode ."
1518 }
1619}
1720
21+ function EnsureDocfxBinaries () {
22+ # Temporary workaround until a proper DocFX build supporting .NET 10 is available.
23+ $zipFile = [IO.Path ]::Combine($env: TEMP , ' docfx-net10-binaries.zip' )
24+
25+ if (! (Test-Path - Path $zipFile )) {
26+ Invoke-WebRequest - Uri ' https://github.com/json-api-dotnet/docfx/raw/refs/heads/dotnet10-rtm/net10-binaries.zip' - Method ' GET' - OutFile $zipFile
27+ Expand-Archive $zipFile - Force
28+ }
29+ }
30+
1831function EnsureHttpServerIsInstalled {
1932 if ((Get-Command " npm" - ErrorAction SilentlyContinue) -eq $null ) {
2033 throw " Unable to find npm in your PATH. please install Node.js first."
@@ -25,9 +38,13 @@ function EnsureHttpServerIsInstalled {
2538
2639 if ($LastExitCode -eq 1 ) {
2740 npm install - g httpserver
41+ VerifySuccessExitCode
2842 }
2943}
3044
45+ EnsureDocfxBinaries
46+ VerifySuccessExitCode
47+
3148EnsureHttpServerIsInstalled
3249VerifySuccessExitCode
3350
@@ -46,7 +63,7 @@ dotnet tool restore
4663VerifySuccessExitCode
4764
4865$env: DOCFX_SOURCE_BRANCH_NAME = " dev"
49- dotnet docfx ./ docfx.json -- warningsAsErrors true
66+ docfx - net10 - binaries / docfx ./ docfx.json -- warningsAsErrors true
5067VerifySuccessExitCode
5168
5269Copy-Item - Force home/* .html _site/
0 commit comments