Files
hermes-agent/scripts
ethernet 6cbd72cec1 fix(install): let the documented scriptblock install run install.ps1
`& ([scriptblock]::Create((irm .../install.ps1)))` is the documented
Windows install form, and on this line it failed twice before doing any
work:

- The MSIX rewrite re-added a UTF-8 BOM that had been stripped twice
  before. Windows PowerShell 5.1 irm keeps it as a literal U+FEFF, so
  param( was no longer the first statement: "The assignment expression is
  not valid".
- Initialize-ResolvedPaths read and wrote $script:HermesHome and
  $script:InstallDir. Under -File, script scope is where param() binds.
  Under the scriptblock form param() binds in the scriptblock scope and
  $script: names the caller session, so -HermesHome read as empty and
  Join-Path threw. Without -HermesHome, the normalized paths never reached
  the bare $HermesHome/$InstallDir every stage reads.

The paths are now computed locally and written to scope 1, where param()
bound under -File, the scriptblock form, and dot-sourcing.

Verified on Windows 11 arm64 (PS 5.1): the old file reproduces both
errors, -ShowResolvedPaths is correct under all three entry forms, and a
fresh install clones into the requested home and reaches pm install.
2026-09-23 15:47:32 -04:00
..