> ## Documentation Index
> Fetch the complete documentation index at: https://help.gorelo.io/llms.txt
> Use this file to discover all available pages before exploring further.

# موجه نموذجي لتوليد نص برمجي بواسطة الذكاء الاصطناعي

> انسخ موجهًا جاهزًا لـ Claude أو مساعد ذكاء اصطناعي آخر لتوليد نصوص PowerShell تستخدم GoreloAction للتنبيهات وحقول الأصول المخصصة.

انسخ والصق الموجه التالي في Claude أو مساعد ذكاء اصطناعي مماثل عندما تحتاج إلى إنشاء نص يستخدم GoreloAction. تأكد من استبدال `[describe your monitoring need]` بمتطلباتك المحددة.

* المثال 1: "monitor disk space usage and alert when drives are below 10% free space."
* المثال 2: "rotates the local admin password daily and writes it to a custom field."

```text theme={null}
I need to create a simple PowerShell script that integrates with Gorelo RMM using GoreloAction. The script should [describe your monitoring need].

GoreloAction supports the following functions:

1. Generate Alerts:
GoreloAction -Alert -Severity <Int> -Name <String> -Description <String> -Suppress <Int>

Severity levels:
- 1: Critical
- 2: Error
- 3: Warning

Example: GoreloAction -Alert -Severity 1 -Name "Critical Error" -Description "Details here" -Suppress 24

2. Write to Custom Fields:
GoreloAction -SetCustomField -Name <String> -Value <String>

Example: GoreloAction -SetCustomField -Name 'asset.lastCheckTime' -Value "2025-03-09 10:30"

3. Read from Custom Fields:
Custom fields can be read using the $gorelo: prefix:
- Client-level: $gorelo:client.fieldName
- Asset-level: $gorelo:asset.fieldName
- File access: $gorelo:file.fileName (Gorelo will automatically download any referenced files before running the script)

Example: 
if($gorelo:client.customToken){
    # Use the token for actions
    $token = $gorelo:client.customToken
}

Example with file:
if($gorelo:file.Installer){
    # Run the installer that was uploaded to Gorelo Files
    Start-Process -FilePath $gorelo:file.Installer -ArgumentList "/quiet" -Wait
}

Please include proper error handling, clear comments, and appropriate alert severity based on the issue detected. Also, please advise on any custom fields or files that need to be created/uploaded in Gorelo before running this script.
```

بمجرد توليد النص، تحدث ذهابًا وإيابًا مع مساعد الذكاء الاصطناعي للتأكد من أنه يغطي احتياجاتك الدقيقة. اختبر النص في Gorelo وانسخ/الصق أي أخطاء إلى مساعد الذكاء الاصطناعي لاستكشافها وإصلاحها (تأكد من تغيير أي -Suppress إلى 0 أثناء الاختبار).
