diff --git a/Dodawanie-custom-fields.md b/Dodawanie-custom-fields.md new file mode 100644 index 0000000..217b314 --- /dev/null +++ b/Dodawanie-custom-fields.md @@ -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'}" +} + +``` \ No newline at end of file