Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PSScriptAnalyzer code quality updates #160

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion Private/Invoke-Scans.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ function Invoke-Scans {

.EXAMPLE
# Perform all scans
Invoke-Scans
Invoke-Scans

.EXAMPLE
# Perform only the 'Auditing' and 'ESC1' scans
Expand All @@ -40,6 +40,8 @@ function Invoke-Scans {
#>

[CmdletBinding()]
[OutputType([hashtable])]
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseSingularNouns', 'Invoke-Scans', Justification='Performing multiple scans.')]
param (
# Could split Scans and PromptMe into separate parameter sets.
[Parameter()]
Expand Down
1 change: 1 addition & 0 deletions Private/Set-Severity.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
function Set-Severity {
[OutputType([string])]
[CmdletBinding()]
param(
[Parameter(Mandatory = $true)]
Expand Down
4 changes: 3 additions & 1 deletion Private/Test-IsMemberOfProtectedUsers.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,11 @@ function Test-IsMemberOfProtectedUsers {
Active Directory user object, user SID, SamAccountName, etc

.OUTPUTS
True, False
Boolean
#>

[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseSingularNouns', 'Test-IsMemberOfProtectedUsers', Justification='The name of the group we are checking is plural.')]
[OutputType([Boolean])]
[CmdletBinding()]
param (
# User parameter accepts any input that is valid for Get-ADUser
Expand Down
5 changes: 1 addition & 4 deletions Private/Test-IsRecentVersion.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,9 @@ function Test-IsRecentVersion {
Published at: 01/28/2024 12:47:18
Install Module: Install-Module -Name Locksmith
Standalone Script: https://github.com/trimarcjake/locksmith/releases/download/v2.6/Invoke-Locksmith.zip

.NOTES
Author: Sam Erde
Date: 02/10/2024
#>
[CmdletBinding()]
[OutputType([boolean])]
param (
# Check a specific version number from the script
[Parameter(Mandatory)]
Expand Down
Loading