Files
PSOPNSenseAPI/docs/cmdlets/Get-OPNSenseConfig.md
T
GraceSolutions 68e6819131 Update configuration management cmdlets
- Added Get-OPNSenseConfig cmdlet that retrieves the OPNSense configuration as an XML document
- Updated Restore-OPNSenseConfig to accept an XML document from the pipeline or as a parameter
- Changed Export-OPNSenseConfig and Import-OPNSenseConfig to use System.IO.FileInfo for the Path parameter
- Removed Backup-OPNSenseConfig cmdlet (use Get-OPNSenseConfig instead)
- Updated documentation and examples
2025-04-15 08:53:09 -04:00

1.4 KiB

Get-OPNSenseConfig

SYNOPSIS

Gets the OPNSense firewall configuration as an XML document.

SYNTAX

Get-OPNSenseConfig

DESCRIPTION

The Get-OPNSenseConfig cmdlet retrieves the OPNSense firewall configuration and returns it as an XML document.

EXAMPLES

Example 1: Get the configuration as an XML document

$config = Get-OPNSenseConfig

This example retrieves the OPNSense firewall configuration as an XML document.

Example 2: Get the configuration and pipe it to Restore-OPNSenseConfig

Get-OPNSenseConfig | Restore-OPNSenseConfig

This example retrieves the OPNSense firewall configuration and restores it.

PARAMETERS

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

INPUTS

None

OUTPUTS

System.Xml.XmlDocument

The OPNSense configuration as an XML document.

NOTES

This cmdlet requires a connection to an OPNSense firewall. Use Connect-OPNSense to establish a connection.

Restore-OPNSenseConfig Export-OPNSenseConfig Import-OPNSenseConfig