Summary
databricks-mcp-server/mcp_install.ps1 and setup.ps1 fail to parse on Windows with a cascade of unrelated-looking syntax errors (unexpected token, missing closing brace, reserved operator <), even though the code itself is valid. Reproduced on both Windows PowerShell 5.1 and PowerShell 7.6.4.
Root cause
Both files are UTF-8 without a BOM, and contain Unicode decoration characters (✓, ✗, ─). Without a BOM, PowerShell's script encoding detection falls back to the system codepage on Windows and misdecodes the multi-byte sequences. One garbled byte sequence produces a stray quote-like character, which desyncs string parsing for the rest of the file.
Confirmed via [System.Management.Automation.Language.Parser]::ParseFile():
mcp_install.ps1: 15 parse errors, first at line 116 (Write-Host "✓" ...)
setup.ps1: 3 parse errors, same cause
Repro
git clone https://github.com/databricks-solutions/ai-dev-kit.git
cd ai-dev-kit
.\databricks-mcp-server\mcp_install.ps1 -Profile <any-profile> -Tools claude
Fails to parse immediately on a stock Windows machine, both shells.
Fix verified locally
Re-saving each file with a UTF-8 BOM resolves all errors with a content-identical diff (only the leading bytes change):
$content = Get-Content -Raw -Encoding UTF8 $path
Set-Content -Path $path -Value $content -Encoding UTF8 -NoNewline
Suggested fix
Save these .ps1 files with a UTF-8 BOM, or replace the Unicode characters with plain ASCII to remove the encoding dependency entirely (more robust than the workaround above).
Environment
OS: Windows 11 Pro
Shells: Windows PowerShell 5.1.26100.8894, PowerShell 7.6.4
Repo commit: 2d83988 (tag v0.2.0)
Summary
databricks-mcp-server/mcp_install.ps1andsetup.ps1fail to parse on Windows with a cascade of unrelated-looking syntax errors (unexpected token, missing closing brace, reserved operator <), even though the code itself is valid. Reproduced on both Windows PowerShell 5.1 and PowerShell 7.6.4.Root cause
Both files are UTF-8 without a BOM, and contain Unicode decoration characters (✓, ✗, ─). Without a BOM, PowerShell's script encoding detection falls back to the system codepage on Windows and misdecodes the multi-byte sequences. One garbled byte sequence produces a stray quote-like character, which desyncs string parsing for the rest of the file.
Confirmed via [System.Management.Automation.Language.Parser]::ParseFile():
mcp_install.ps1:15 parse errors, first at line 116 (Write-Host "✓" ...)setup.ps1: 3 parse errors, same causeRepro
Fails to parse immediately on a stock Windows machine, both shells.
Fix verified locally
Re-saving each file with a UTF-8 BOM resolves all errors with a content-identical diff (only the leading bytes change):
Suggested fix
Save these
.ps1files with a UTF-8 BOM, or replace the Unicode characters with plain ASCII to remove the encoding dependency entirely (more robust than the workaround above).Environment
OS: Windows 11 Pro
Shells: Windows PowerShell 5.1.26100.8894, PowerShell 7.6.4
Repo commit:
2d83988(tagv0.2.0)