Skip to content

Commit

Permalink
Merge pull request #23 from johnduprey/dev
Browse files Browse the repository at this point in the history
PSScriptAnalyzer Fixes
  • Loading branch information
JohnDuprey authored Apr 16, 2023
2 parents ed7f7fc + b3b401e commit 3b243dd
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ function New-DuoIntegration {
if ($Greeting) { $Params.greeting = $Greeting }
if ($GroupsAllowed) { $Params.groups_allowed = ($GroupsAllowed -join ',') }
if ($Notes) { $Params.notes = $Notes }
if ($SelfServiceAllowed) { $Params.self_service_allowed = $SelfServiceAllowed }
if ($UsernameNormalizationPolicy) { $Params.username_normalization_policy = $UsernameNormalizationPolicy }

$DuoRequest = @{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ function Update-DuoIntegration {
if ($PolicyKey) { $Params.policy_key = $PolicyKey }
if ($PromptV4Enabled) { $Params.prompt_v4_enabled = $PromptV4Enabled }
if ($ResetSecretKey) { $Params.reset_secret_key = $ResetSecretKey }
if ($SelfServiceAllowed) { $Params.self_service_allowed = $SelfServiceAllowed }
if ($UsernameNormalizationPolicy) { $Params.username_normalization_policy = $UsernameNormalizationPolicy }

$DuoRequest = @{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@ function Get-DuoTrustMonitorEvents {
#>
[CmdletBinding()]
Param(
[Parameter(Mandatory=$true,ParameterSetName='Days')]
[Parameter(Mandatory = $true, ParameterSetName = 'Days')]
[int]$Days,

[Parameter(Mandatory = $true, ParameterSetName = 'Hours')]
[int]$Hours,

[Parameter(Mandatory=$true,ParameterSetName='MinMaxTime')]
[Parameter(Mandatory = $true, ParameterSetName = 'MinMaxTime')]
[string]$MinTime,

[Parameter(Mandatory = $true, ParameterSetName = 'MinMaxTime')]
Expand All @@ -55,7 +55,7 @@ function Get-DuoTrustMonitorEvents {
[datetime]$EndDate,

[Parameter()]
[ValidateSet('auth','bypass_status_enabled')]
[ValidateSet('auth', 'bypass_status_enabled')]
[string]$Type
)

Expand All @@ -72,8 +72,7 @@ function Get-DuoTrustMonitorEvents {
if ($StartDate) {
if ($EndDate) {
$MaxTime = $EndDate | Get-Date -UFormat '%s000'
}
else {
} else {
$MaxTime = Get-Date -UFormat '%s000'
}
$MinTime = $StartDate | Get-Date -UFormat '%s000'
Expand All @@ -84,7 +83,7 @@ function Get-DuoTrustMonitorEvents {
maxtime = $MaxTime.ToString()
}

if ($types) { $Params.types = $Types }
if ($Type) { $Params.type = $Type }


$DuoRequest = @{
Expand All @@ -95,8 +94,7 @@ function Get-DuoTrustMonitorEvents {
$Response = Invoke-DuoRequest @DuoRequest
if ($Response.stat -eq 'OK') {
$Response.response.events
}
else {
} else {
$Response
}
}

0 comments on commit 3b243dd

Please sign in to comment.