Skip to content

Commit

Permalink
PSScriptAnalyzer fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnDuprey committed Apr 16, 2023
1 parent 9abed01 commit 63c8366
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 12 deletions.
4 changes: 2 additions & 2 deletions DuoSecurity/Private/Base64/ConvertFrom-Base64.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ function ConvertFrom-Base64 {
.PARAMETER Base64
File contents in Base64 string
.PARAMETER Path
Path to the file
.EXAMPLE
ConvertTo-Base64 -Path path/to/file.png
#>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,7 @@ function Set-DuoCustomBranding {
if (Test-PngFile -Path $BackgroundImg) {
$BackgroundImg = ConvertTo-Base64 -Path $BackgroundImg
} else {
Write-Error "$BackgroundImg is not a PNG file"
return $false
throw "$BackgroundImg is not a PNG file"
}
}
$Params.background_img = $BackgroundImg
Expand All @@ -100,8 +99,7 @@ function Set-DuoCustomBranding {
if (Test-PngFile -Path $Logo) {
$Logo = ConvertTo-Base64 -Path $Logo
} else {
Write-Error "$Logo is not a PNG file"
return $false
throw "$Logo is not a PNG file"
}
}
$Params.background_img = $BackgroundImg
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,16 +59,14 @@ function Send-DuoPhoneActivationSms {
$Params.install = $Install
if ($InstallationMsg) {
if ($InstallationMsg -notmatch '<insturl>') {
Write-Error 'Installation message must contain <insturl>'
return $false
throw 'Installation message must contain <insturl>'
}
$Params.installation_msg = $InstallationMsg
}
}
if ($ActivationMsg) {
if ($ActivationMsg -notmatch '<acturl>') {
Write-Error 'Activation message must contain <acturl>'
return $false
throw 'Activation message must contain <acturl>'
}
$Params.activation_msg = $ActivationMsg
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@ function Send-DuoPhoneInstallationSms {
$Params = @{}
if ($InstallationMsg) {
if ($InstallationMsg -notmatch '<insturl>') {
Write-Error 'Installation message must contain <insturl>'
return $false
throw 'Installation message must contain <insturl>'
}
$Params.installation_msg = $InstallationMsg
}
Expand Down

0 comments on commit 63c8366

Please sign in to comment.