---
title: Get Firewall Rules From Scope
slug: homologacao-atmosphere/get-firewall-rules-from-scope
description: Learn how to use the "Get-NetFirewallProfile" PowerShell command to retrieve firewall rules within a specific profile scope. This document provides a comprehensive summary, including parameter details and practical examples. Discover the values returned b
createdAt: 2022-07-06T18:27:39.000Z
---

## Resumo

- Recupera todas as regras de firewall com escopo de um perfil.

## Parâmetros

| **Parâmetro**                                                                                                                                                                                                                                                                             | **Tipo** | **Escolhas \| Valor Padrão**                                                          | **Comentários**                                                                                                                                                  |
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- | ------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| scope<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   | - Any ***(default)***<br />- Domain<br />- NotApplicable<br />- Public<br />- Private | Escopo a ser filtrado.<br />string<br />- Any ***(default)***<br />- Domain<br />- NotApplicable<br />- Public<br />- Private<br />Service Group a ser filtrado. |

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

## Exemplos

```yaml
# Exemplo: Este exemplo obtém todas as máquinas virtuais no host da máquina virtual local.
tasks:
  powershell_command:
    server: "{{ server }}"
    port: "{{ input.port }}"
		ssl: "{{ input.ssl }}"
    username: "{{ username }}"
    password: "{{ password }}"
    show_errors: true
		show_warnings: true
    command: |
      Get-NetFirewallProfile -Name {{ input.scope }} | Get-NetFirewallRule
  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            |

