chezmoi: Powershell one-line install on Windows 11 error - "You cannot call a method on a null-valued expression"

Describe the bug

I did a fresh install of Windows 11, and one of the first things I did on it was try to install chezmoi.

I followed the install docs to install via a Powershell one liner, and ran this:

iex "&{$(irm 'https://get.chezmoi.io/ps1')}"

Unfortunately, it returned this error:

You cannot call a method on a null-valued expression.
At line:1 char:1
+ &{<#
+ ~~~~
    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : InvokeMethodOnNull

To reproduce

See above. I was on a fresh install but it was a company managed Windows 11, so it’s not at completely generic / stock settings.

Expected behavior

Chezmoi should download + install.

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 17 (9 by maintainers)

Most upvoted comments

I suppose we could manually trigger a rebuild though.

This is generally dangerous, as the rebuilt website will also include updated documentation which refers to an unreleased version of chezmoi.