> ## 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 從你的指令稿產生警示並寫入自訂資產欄位，支援 severity、name 與 suppress 參數。

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>
