Skip to content

Commit

Permalink
Merge pull request #18 from johnduprey/dev
Browse files Browse the repository at this point in the history
PSScriptAnalyzer fixes
  • Loading branch information
JohnDuprey authored Mar 10, 2023
2 parents 555f5aa + 500f3a6 commit 9d32e0b
Show file tree
Hide file tree
Showing 13 changed files with 46 additions and 31 deletions.

This file was deleted.

18 changes: 10 additions & 8 deletions DuoSecurity/Public/Accounts API/Remove-DuoAccount.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,17 @@ function Remove-DuoAccount {
[string]$AccountId
)

$DuoRequest = @{
Method = 'POST'
Path = '/accounts/v1/account/delete'
Params = @{
account_id = $AccountId
process {
$DuoRequest = @{
Method = 'POST'
Path = '/accounts/v1/account/delete'
Params = @{
account_id = $AccountId
}
}
}

if ($PSCmdlet.ShouldProcess($AccountId)) {
Invoke-DuoRequest @DuoRequest
if ($PSCmdlet.ShouldProcess($AccountId)) {
Invoke-DuoRequest @DuoRequest
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ function Sync-DuoAdminFromDirectory {
Synchronize Admin from Directory
.DESCRIPTION
Initiate a sync to create, update, or mark for deletion the administrator specified by email against the directory specified by the directory_key. The directory_key for a directory can be found by navigating to Administrators Admin Directory Sync in the Duo Admin Panel, and then clicking on the configured directory. Learn more about syncing individual admins from Active Directory, OpenLDAP, or Azure Active Directory. Requires "Grant administrators" API permission.
Initiate a sync to create, update, or mark for deletion the administrator specified by email against the directory specified by the directory_key. The directory_key for a directory can be found by navigating to Administrators -> Admin Directory Sync in the Duo Admin Panel, and then clicking on the configured directory. Learn more about syncing individual admins from Active Directory, OpenLDAP, or Azure Active Directory. Requires "Grant administrators" API permission.
.PARAMETER DirectoryKey
The directory key to sync from
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ function Set-DuoCustomBranding {
Updates current custom messaging settings, shown to users in the Universal Prompt. These settings can also be viewed and set in the Duo Admin Panel. Supersedes the helpdesk_message Settings parameter. Requires "Grant settings" API permission.
.PARAMETER HelpLinks
A comma-separated list of up to two custom external links shown to users in the Universal Prompt. Each URL must begin with http:// or https://.
A comma-separated list of up to two custom external links shown to users in the Universal Prompt. Each URL must begin with http:// or https://
.PARAMETER HelpText
Customized text string associated with the specified locale. The user's browser's preferred language settings determine which language to show in the Universal Prompt. The first locale and message text in the list matches the default language specified in global Settings and is also shown in the traditional web prompt and in the Duo Device Health app. Up to 200 characters. No support for hyperlinks.
.PARAMETER Locale
The language of the help text. One of: en_US (English), cs_CZ (Czech), de_DE (German), es_ES (Spanish - Spain), es_419 (Spanish - Latin America), fi_FI (Finnish), fr_FR (French), hi_IN (Hindi), id_ID (Indonesian), it_IT (Italian), ja_JP (Japanese), ko_KR (Korean), nb_NO (Norwegian - Bokmål), pl_PL (Polish), pt_BR (Portuguese - Brazil), sv_SE (Swedish), th_TH (Thai), tr_TR (Turkish), vi_VN (Vietnamese), or zh_hans_CN (Chinese - Simplified).
The language of the help text. One of: en_US (English), cs_CZ (Czech), de_DE (German), es_ES (Spanish - Spain), es_419 (Spanish - Latin America), fi_FI (Finnish), fr_FR (French), hi_IN (Hindi), id_ID (Indonesian), it_IT (Italian), ja_JP (Japanese), ko_KR (Korean), nb_NO (Norwegian - Bokmal), pl_PL (Polish), pt_BR (Portuguese - Brazil), sv_SE (Swedish), th_TH (Thai), tr_TR (Turkish), vi_VN (Vietnamese), or zh_hans_CN (Chinese - Simplified).
.EXAMPLE
Set-DuoCustomMessaging -HelpLinks 'https://duo.com/docs/adminapi#modify-custom-messaging'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
function Get-DuoAdminLogs {
function Get-DuoAdminLog {
<#
.SYNOPSIS
Administrator Logs
Expand All @@ -10,7 +10,7 @@ function Get-DuoAdminLogs {
Limit report to events after this Unix timestamp.
.EXAMPLE
Get-DuoUserAuthenticationAttempts
Get-DuoAdminLog
.LINK
https://duo.com/docs/adminapi#administrator-logs
Expand Down Expand Up @@ -66,4 +66,6 @@ function Get-DuoAdminLogs {
$Request.response
}

}
}

Set-Alias -Name Get-DuoAdminLogs -Value Get-DuoAdminLog
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
function Get-DuoAuthLogs {
function Get-DuoAuthLog {
<#
.SYNOPSIS
Authentication Logs
Expand Down Expand Up @@ -151,7 +151,7 @@ function Get-DuoAuthLogs {
https://duo.com/docs/adminapi#authentication-logs
.EXAMPLE
Get-DuoAuthLogs -Days 30 -EventTypes authentication -Factors duo_push -Results denied
Get-DuoAuthLog -Days 30 -EventTypes authentication -Factors duo_push -Results denied
.NOTES
There is an intentional two minute delay in availability of new authentications in the API response. Duo operates a large scale distributed system, and this two minute buffer period ensures that calls will return consistent results. Querying for results more recent than two minutes will return as empty.
Expand Down Expand Up @@ -258,3 +258,5 @@ function Get-DuoAuthLogs {
$Response
}
}

Set-Alias -Name Get-DuoAuthLogs -Value Get-DuoAuthLog
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
function Get-DuoOfflineEnrollmentLogs {
function Get-DuoOfflineEnrollmentLog {
<#
.SYNOPSIS
Offline Enrollment Logs
Expand All @@ -12,7 +12,7 @@ function Get-DuoOfflineEnrollmentLogs {
Only return records that have a Unix timestamp in seconds of mintime or later. Use mintime+1 to avoid receiving duplicate data.
.EXAMPLE
Get-DuoOfflineEnrollmentLogs
Get-DuoOfflineEnrollmentLog
.LINK
https://duo.com/docs/adminapi#offline-enrollment-logs
Expand Down Expand Up @@ -68,4 +68,6 @@ function Get-DuoOfflineEnrollmentLogs {
$Request.response
}

}
}

Set-Alias -Name Get-DuoOfflineEnrollmentLogs -Value Get-DuoOfflineEnrollmentLog
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
function Get-DuoTelephonyLogs {
function Get-DuoTelephonyLog {
<#
.SYNOPSIS
Telephony Logs
Expand All @@ -10,7 +10,7 @@ function Get-DuoTelephonyLogs {
Limit report to events after this Unix timestamp.
.EXAMPLE
Get-DuoTelephonyLogs
Get-DuoTelephonyLog
.LINK
https://duo.com/docs/adminapi#telephony-logs
Expand Down Expand Up @@ -66,4 +66,6 @@ function Get-DuoTelephonyLogs {
$Request.response
}

}
}

Set-Alias -Name Get-DuoTelephonyLogs -Value Get-DuoTelephonyLog
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
function Get-DuoPhones {
function Get-DuoPhone {
<#
.SYNOPSIS
Retrieve Phones
Expand Down Expand Up @@ -66,4 +66,4 @@ function Get-DuoPhones {
}
}

Set-Alias -Name Get-DuoPhone -Value Get-DuoPhones
Set-Alias -Name Get-DuoPhones -Value Get-DuoPhone
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
function Send-DuoPhoneSmsPasscodes {
function Send-DuoPhoneSmsPasscode {
<#
.SYNOPSIS
Send Passcodes via SMS
Expand All @@ -10,7 +10,7 @@ function Send-DuoPhoneSmsPasscodes {
Id of phone
.EXAMPLE
Send-DuoPhoneSmsPasscodes -PhoneId SOMEDUOID
Send-DuoPhoneSmsPasscode -PhoneId SOMEDUOID
.LINK
https://duo.com/docs/adminapi#send-passcodes-via-sms
Expand All @@ -37,3 +37,5 @@ function Send-DuoPhoneSmsPasscodes {
}
}
}

Set-Alias -Name Send-DuoPhoneSmsPasscodes -Value Send-DuoPhoneSmsPasscode
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
function Get-DuoSettings {
function Get-DuoSetting {
<#
.SYNOPSIS
Retrieve Settings
Expand Down Expand Up @@ -28,3 +28,5 @@ function Get-DuoSettings {
$Request.response
}
}

Set-Alias -Name Get-DuoSettings -Value Get-DuoSetting
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
function Update-DuoSettings {
function Update-DuoSetting {
<#
.SYNOPSIS
Modify Settings
Expand Down Expand Up @@ -82,7 +82,7 @@ function Update-DuoSettings {
The maximum number of telephony credits a user may consume in a single authentication event. This excludes Duo administrators authenticating to the Duo administration panel. If you know the countries from which your users expect to authenticate with phone callback we recommend adjusting this down from the default to match the most expensive expected country to help avoid misuse, using the values from the Telephony Credits documentation. Default: 20.
.EXAMPLE
Update-DuoSettings -FraudEmail [email protected]
Update-DuoSetting -FraudEmail [email protected]
.LINK
https://duo.com/docs/adminapi#modify-settings
Expand Down Expand Up @@ -227,3 +227,5 @@ function Update-DuoSettings {
}
}
}

Set-Alias -Name Update-DuoSettings -Value Update-DuoSetting
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ function Sync-DuoUserFromDirectory {
Synchronize User from Directory
.DESCRIPTION
Initiate a sync to create, update, or mark for deletion the user specified by username against the directory specified by the directory_key. The directory_key for a directory can be found by navigating to Users Directory Sync in the Duo Admin Panel, and then clicking on the configured directory. Learn more about syncing individual users from Active Directory, OpenLDAP, or Azure Active Directory. Requires "Grant write resource" API permission.
Initiate a sync to create, update, or mark for deletion the user specified by username against the directory specified by the directory_key. The directory_key for a directory can be found by navigating to Users -> Directory Sync in the Duo Admin Panel, and then clicking on the configured directory. Learn more about syncing individual users from Active Directory, OpenLDAP, or Azure Active Directory. Requires "Grant write resource" API permission.
.PARAMETER DirectoryKey
The directory key to sync from
Expand Down

0 comments on commit 9d32e0b

Please sign in to comment.