Skip to content

Commit

Permalink
DeviceFingerprint: Add throw when using with CPPM <= 6.9.0
Browse files Browse the repository at this point in the history
  • Loading branch information
alagoutte committed Mar 24, 2021
1 parent fd50fb6 commit 19b2624
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions PowerArubaCP/Public/DeviceFingerprint.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,10 @@ function Get-ArubaCPDeviceFingerprint {

Process {

if ($connection.version -lt [version]"6.9.0") {
throw "Need ClearPass >= 6.9.0 for use this cmdlet"
}

$invokeParams = @{ }

$uri = "api/device-profiler/device-fingerprint/"
Expand Down
4 changes: 4 additions & 0 deletions Tests/integration/DeviceFingerprint.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ Describe "Get Device FingerPrint" {
$dfp.device_family | Should -Not -BeNullOrEmpty
}

It "Get Device Fingerprint throw a error when use with CPPM <= 6.9.0" -Skip: ($VersionBefore690 -eq 0) {
{ Get-ArubaCPDeviceFingerprint -ip_address 192.0.2.2 } | Should -Throw "Need ClearPass >= 6.9.0 for use this cmdlet"
}

AfterAll {
if ($VersionBefore690 -eq 0) {
#Remove 2 entries
Expand Down

0 comments on commit 19b2624

Please sign in to comment.