> ## 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.

# GoreloAction CLI（通过 PowerShell）

> 使用 GoreloAction PowerShell CLI 从你的脚本生成告警并写入自定义资产字段，提供严重程度、名称和抑制等参数。

GoreloAction 是一个命令行工具，使 PowerShell 脚本能够与 Gorelo 交互。它目前支持：

* 生成告警。
* 写入自定义资产字段。

## 使用 GoreloAction

<Tabs>
  <Tab title="生成告警">
    在你的终端中运行以下命令，并将 `<String>` 替换为参数值：

    ```powershell theme={null}
    GoreloAction -Alert -Severity <Int> -Name <String> -Description <String> -Suppress <Int>
    ```

    ### 参数

    | 选项             | 描述                                                                         |
    | -------------- | -------------------------------------------------------------------------- |
    | `-Alert`       | 指定告警创建模式。                                                                  |
    | `-Severity`    | 设置严重程度级别（整数）<ul><li>1：Critical</li><li>2：Error</li><li>3：Warning</li></ul> |
    | `-Name`        | Gorelo 中告警的标题/名称。                                                          |
    | `-Description` | Gorelo 中告警的详细描述（可选）。                                                       |
    | `-Suppress`    | 告警抑制持续时间，以小时为单位（可选，默认为 4，使用 0 表示不抑制）。                                      |
    |                |                                                                            |

    #### 示例

    ```powershell theme={null}
    GoreloAction -Alert -Severity 1 -Name "NameHere" -Description "DescriptionHere" -Suppress 0
    ```
  </Tab>

  <Tab title="写入自定义资产字段">
    在你的终端中运行以下命令，并将 `<String>` 替换为参数值：

    ```powershell theme={null}
    GoreloAction -SetCustomField -Name <String> -Value <String>
    ```

    #### 参数

    | 选项                | 描述                                                                       |
    | ----------------- | ------------------------------------------------------------------------ |
    | `-SetCustomField` | 指定自定义字段写入模式。                                                             |
    | `-Name`           | 字段标识符：<ul><li>格式：`'asset.fieldname'`</li><li>从变量中移除 `$gorelo`：</li></ul> |
    | `-Value`          | 要存储在字段中的数据。                                                              |

    #### 示例

    ```powershell theme={null}
    GoreloAction -SetCustomField -Name 'asset.rustdeskPassword' -Value "SecurePassword123"
    ```
  </Tab>
</Tabs>
