Skip to content

Commit

Permalink
docs: Refactor Windows chassisType template
Browse files Browse the repository at this point in the history
  • Loading branch information
bradenhilton authored and twpayne committed Jun 7, 2022
1 parent d3acb67 commit 814f1f2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion assets/chezmoi.io/docs/user-guide/machines/general.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ The following template sets the `$chassisType` variable to `"desktop"` or
{{- else if eq .chezmoi.os "linux" }}
{{- $chassisType = (output "hostnamectl" "--json=short" | mustFromJson).Chassis }}
{{- else if eq .chezmoi.os "windows" }}
{{- $chassisType = (output "powershell.exe" "-noprofile" "-command" "if (Get-WmiObject -Class win32_battery -ComputerName localhost) { echo laptop } else { echo desktop }") }}
{{- $chassisType = (output "powershell.exe" "-NoProfile" "-NonInteractive" "-Command" "if ((Get-CimInstance -Class Win32_Battery | Measure-Object).Count -gt 0) { Write-Output 'laptop' } else { Write-Output 'desktop' }") | trim }}
{{- end }}
```

0 comments on commit 814f1f2

Please sign in to comment.