---
title: Copies a Firewall Rule
slug: homologacao-atmosphere/copies-a-firewall-rule
description: Learn how to use a PowerShell command to effortlessly copy a firewall rule with this comprehensive document. Discover the essential parameters, including display name and copy name, and explore a practical example. Gain insights into the values returned, 
createdAt: 2022-07-25T17:44:36.000Z
---

## Resumo

- Copia uma regra Firewall.

## Parâmetros

Utiliza parâmetros do módulo [Powershell Command](https://docs.simonops.com/homologacao-atmosphere/powershell-command).

| **Parâmetro**                                                                                                                                                                                                                                                                                     | **Tipo** | **Escolhas \| Valor Padrão** | **Comentários**                                                                                                                                                  |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- | ---------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| display\_name<br />string<br />- Any ***(default)***<br />- Domain<br />- NotApplicable<br />- Public<br />- Private<br />Service Group a ser filtrado.<br />string<br />- Any ***(default)***<br />- Domain<br />- NotApplicable<br />- Public<br />- Private<br />Service Group a ser filtrado. | string   |                              | Nome dado a rule<br /><br />string<br />- Any ***(default)***<br />- Domain<br />- NotApplicable<br />- Public<br />- Private<br />Service Group a ser filtrado. |
| copy\_name                                                                                                                                                                                                                                                                                        | string   |                              | Nome da copia<br />                                                                                                                                              |

## Exemplos

```yaml
- name: Copies a Firewall Rule
  powershell_command:
    server: "{{ input.server }}"
		ssl: "{{ input.ssl }}"
    username: "{{ input.username }}"
    password: "{{ input.password }}"
		show_errors: "{{ input.show_errors }}"
		show_warnings: "{{ input.show_warnings }}"
    command: |
      Copy-NetFirewallRule -DisplayName "{{ input.rule_name }}" -NewName "{{ input.copy_name }}"
  register: result
  - debug:
    msg: |
      {{ result.output }}
      {{ result.had_errors }}
      {{ result.output_errors }}
      {{ result.output_warnings }}

  
```

## Valores retornados

| **Chave**        | **Tipo** | **Retornado quando** | **Descrição**              |
| ---------------- | -------- | -------------------- | -------------------------- |
| output           | string   | Sempre               | Saída da execução          |
| had\_errors      | boolean  | Sempre               | Se teve erros              |
| output\_errors   | string   | Sempre               | Erros de saída da execução |
| output\_warnings | string   | Sempre               | Avisos de saída            |

