Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
fvanroie committed Mar 3, 2018
2 parents 21d2338 + 646d268 commit fb4fe1a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
11 changes: 10 additions & 1 deletion Core/_Connect-OPNsense.Tests.ps1
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
Import-Module PS_OPNsense -force

. ..\..\..\Wiki\PS_OPNsense.wiki\Test-Module.ps1
# Define connection parameters
$apiKey = $env:OPNkey
$apiPwd = $env:OPNpwd | ConvertTo-SecureString -AsPlainText -Force
$Url = $env:OPNurl

# Convert the connection parameters into a PowerShell Credentials Object
$apiCred = New-Object System.Management.Automation.PSCredential -ArgumentList $apiKey, $apiPwd

# Connect to OPNsense server
$conn = Connect-OPNsense -Url $Url -Credential $apiCred -SkipCertificateCheck -Verbose:$beVerbose #-WebCredential $webCred

Function Compare-Json ($value, $expected) {
[String]::Compare(($value | ConvertTo-Json -Depth 15), ($expected | ConvertTo-Json -Depth 15), $true)
Expand Down
4 changes: 2 additions & 2 deletions Examples/Connect.Example.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Import-Module -Name PS_OPNsense -Verbose:$beVerbose
# Define connection parameters
$apiKey = '<my OPNsense api key>'
$apiPwd = '<my OPNsense api secret>' | ConvertTo-SecureString -AsPlainText -Force
$Url = 'https://opnsense.localdomain:80'
$Url = 'https://opnsense.localdomain:443'

# Convert the connection parameters into a PowerShell Credentials Object
$apiCred = New-Object System.Management.Automation.PSCredential -ArgumentList $apiKey, $apiPwd
Expand All @@ -31,4 +31,4 @@ Invoke-OPNsenseAudit -Raw -Verbose:$beVerbose | Format-List


## Disconnect from OPNsense server
Disconnect-OPNsense -Verbose:$beVerbose
# Disconnect-OPNsense -Verbose:$beVerbose

0 comments on commit fb4fe1a

Please sign in to comment.