1
Dodawanie custom fields
Kacper Żbikowski edited this page 2026-04-02 14:09:45 +02:00
This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

Custom fields definiuje się w sekcji:

"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:

"_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):

"_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'}"
}