mirror of
https://github.com/freedbygrace/PSOPNSenseAPI.git
synced 2026-07-27 20:29:11 +00:00
Add port forwarding support, improve XML documentation, and add unit tests
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
# 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 all installed plugins
|
||||
$installedPlugins = Get-OPNSensePlugin -Installed
|
||||
$installedPlugins | Format-Table -Property Name, Version, Comment, Enabled
|
||||
|
||||
# Get all available plugins
|
||||
$availablePlugins = Get-OPNSensePlugin -Available
|
||||
$availablePlugins | Format-Table -Property Name, Version, Comment
|
||||
|
||||
# Install a plugin
|
||||
Install-OPNSensePlugin -Name "os-acme-client" -Wait
|
||||
Write-Output "Plugin installed successfully"
|
||||
|
||||
# Enable a plugin
|
||||
Enable-OPNSensePlugin -Name "os-acme-client"
|
||||
|
||||
# Disable a plugin
|
||||
Disable-OPNSensePlugin -Name "os-acme-client"
|
||||
|
||||
# Uninstall a plugin
|
||||
Uninstall-OPNSensePlugin -Name "os-acme-client" -Wait -Confirm:$false
|
||||
|
||||
# Disconnect from the firewall
|
||||
Disconnect-OPNSense
|
||||
Reference in New Issue
Block a user