Skip to content

Error running UpdateTemplate.ps1: "Unexpected token '??' in expression or statement." #8130

@mstefarov

Description

@mstefarov

I am trying to build docfx from source but running into a PowerShell error.

Operating System: Windows 10 Enterprise (21H2), powershell 5.1.19041.1682, nuget 5.9.1.11

DocFX Version Used: latest dev (d111647)

Steps to Reproduce:

  1. Run build.cmd on a freshly checked-out copy of the docfx repo.

Expected Behavior:
It builds!

Actual Behavior:
Build fails with:

PS R:\github\docfx> .\build.cmd
Running on OS Windows
Using Nuget Command: C:\Users\matv8981.AVWORLD\AppData\Local\Nuget\nuget.exe, NuGet Version: 5.9.1.11
At R:\github\docfx\UpdateTemplate.ps1:76 char:58
+         $baseDir = "$using:templateHome\$($fileGroup.cwd ?? $_)"
+                                                          ~~
Unexpected token '??' in expression or statement.
    + CategoryInfo          : ParserError: (:) [], ParentContainsErrorRecordException
    + FullyQualifiedErrorId : UnexpectedToken

The offending line:

$baseDir = "$using:templateHome\$($fileGroup.cwd ?? $_)"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions