mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2025-01-22 00:21:11 -08:00
48 lines
1.2 KiB
Markdown
48 lines
1.2 KiB
Markdown
---
|
|
id: winreg
|
|
title: Windows Registry Key Query
|
|
sidebar_label: Windows Registry Key Query
|
|
---
|
|
|
|
## What
|
|
|
|
Display the content of the requested Windows registry key.
|
|
|
|
Supported registry key types:
|
|
|
|
- String
|
|
- DWORD (displayed in upper-case 0x hex)
|
|
|
|
## Sample Configuration
|
|
|
|
```json
|
|
{
|
|
"type": "winreg",
|
|
"style": "powerline",
|
|
"powerline_symbol": "\uE0B0",
|
|
"foreground": "#ffffff",
|
|
"background": "#444444",
|
|
"properties": {
|
|
"path": "HKLM\\software\\microsoft\\windows nt\\currentversion",
|
|
"key":"buildlab",
|
|
"template":"{{ if .Value }}{{ .Value }}{{ else }}unknown{{ end }}",
|
|
"prefix": " \uE62A "
|
|
}
|
|
},
|
|
```
|
|
|
|
## Properties
|
|
|
|
- path: `string` - registry path to the desired key using backslashes and with a valid root HKEY name.
|
|
- key: `string` - the key to read from the `path` location.
|
|
- fallback: `string` - the value to fall back to if no entry is found
|
|
- template: `string` - a go [text/template][go-text-template] template extended
|
|
with [sprig][sprig] utilizing the properties below.
|
|
|
|
## Template Properties
|
|
|
|
- .Value: `string` - The result of your query
|
|
|
|
[go-text-template]: https://golang.org/pkg/text/template/
|
|
[sprig]: https://masterminds.github.io/sprig/
|