mirror of
https://github.com/freedbygrace/PSOPNSenseAPI.git
synced 2026-08-05 08:27:45 +00:00
Add port forwarding support, improve XML documentation, and add unit tests
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
# Import the module
|
||||
Import-Module PSOPNSenseAPI
|
||||
|
||||
# Connect to the OPNSense firewall
|
||||
Connect-OPNSense -Server "https://firewall.example.com" -ApiKey "your_api_key" -ApiSecret "your_api_secret" -SkipCertificateCheck
|
||||
|
||||
# Get firmware status
|
||||
$firmwareStatus = Get-OPNSenseFirmware
|
||||
Write-Output "Firmware Status:"
|
||||
$firmwareStatus
|
||||
|
||||
# Check for updates
|
||||
Get-OPNSenseFirmware -Check
|
||||
|
||||
# Get firmware changelog
|
||||
$changelog = Get-OPNSenseFirmware -Changelog
|
||||
Write-Output "Firmware Changelog:"
|
||||
$changelog
|
||||
|
||||
# Get firmware audit
|
||||
$audit = Get-OPNSenseFirmware -Audit
|
||||
$audit | Format-Table -Property Name, Version, Installed
|
||||
|
||||
# Update firmware (install updates)
|
||||
Update-OPNSenseFirmware -Wait
|
||||
Write-Output "Firmware updated successfully"
|
||||
|
||||
# Upgrade firmware (major version upgrade)
|
||||
# Note: This will restart the firewall
|
||||
# Upgrade-OPNSenseFirmware -Wait -Timeout 1200
|
||||
|
||||
# Restart the firewall
|
||||
Restart-OPNSenseFirewall -Wait -Timeout 300
|
||||
Write-Output "Firewall restarted successfully"
|
||||
|
||||
# Disconnect from the firewall
|
||||
Disconnect-OPNSense
|
||||
Reference in New Issue
Block a user