mirror of
https://github.com/freedbygrace/PSOPNSenseAPI.git
synced 2026-08-12 19:57:33 +00:00
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
This commit is contained in:
@@ -0,0 +1,52 @@
|
||||
# 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
|
||||
```powershell
|
||||
$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
|
||||
```powershell
|
||||
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](http://go.microsoft.com/fwlink/?LinkID=113216).
|
||||
|
||||
## 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.
|
||||
|
||||
## RELATED LINKS
|
||||
|
||||
[Restore-OPNSenseConfig](Restore-OPNSenseConfig.md)
|
||||
[Export-OPNSenseConfig](Export-OPNSenseConfig.md)
|
||||
[Import-OPNSenseConfig](Import-OPNSenseConfig.md)
|
||||
Reference in New Issue
Block a user