Add Dodawanie custom fields

2026-04-02 14:09:45 +02:00
parent 88e97bc06d
commit 203344414b

@@ -0,0 +1,52 @@
### Custom fields definiuje się w sekcji:
```json
"fields": {
"custom_fields": {
"_snipeit_example_1": {
"name": "Example Field",
"enabled": true,
"ps_command": "Get-Date",
"float_number": false
}
}
}
```
### Parametry:
- `name` nazwa pola (tylko informacyjna)
- `enabled` czy pole jest aktywne
- `ps_command` komenda PowerShell zwracająca wartość
- `float_number` (opcjonalne) czy wynik ma być traktowany jako liczba
----------
### Przykład RAM:
```json
"_snipeit_ram_4": {
"name": "RAM (GB)",
"enabled": true,
"ps_command": "[math]::Round((Get-CimInstance Win32_ComputerSystem).TotalPhysicalMemory / 1GB, 0)"
}
```
----------
### Przykład Disk Type (NVMe/SATA):
```json
"_snipeit_disk_type_27": {
"name": "Disk Type",
"enabled": true,
"ps_command": "($d=Get-CimInstance Win32_DiskDrive|Select-Object -First 1)|Out-Null;if($d.Model -match 'NVMe'){'NVMe'}elseif($d.MediaType -match 'SSD'){'SATA SSD'}elseif($d.MediaType -match 'HDD'){'HDD'}else{'Unknown'}"
}
```