$output = & GitVersion /output json /nofetch if ($LASTEXITCODE -ne 0) { Write-Verbose "$output" throw "GitVersion failed with exit code: $LASTEXITCODE" } $version = $output | ConvertFrom-Json @" #ifndef __Version #define __Version static const char* FirmwareVersion = "{0}"; #endif "@ -f $version.FullSemVer | Out-File -Encoding UTF8 .\src\version.h @" module.exports = {{ Version: "{0}" }}; "@ -f $version.FullSemVer | Out-File -Encoding UTF8 .\web\version.js