Skip to content

Commit

Permalink
Merge pull request #75 from TrimarcJake/testing
Browse files Browse the repository at this point in the history
2023.11 Release
  • Loading branch information
TrimarcJake authored Nov 11, 2023
2 parents 2abaab8 + 4093489 commit 6d948d4
Show file tree
Hide file tree
Showing 10 changed files with 904 additions and 359 deletions.
22 changes: 22 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# EditorConfig is awesome: https://EditorConfig.org

# top-most EditorConfig file
root = true

[*]
charset = utf-8
indent_style = space
indent_size = 4
trim_trailing_whitespace = true
insert_final_newline = true

# Powershell files
[*.{ps1,psd1,psm1}]
indent_size = 4

[*.md]
indent_size = 2

# Data serialization
[*.{json,yaml,yml}]
indent_size = 2
15 changes: 9 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
Ignore/*
.DS_Store
.vs/*
.vscode/*
Examples/Output/*
Releases/*
ADCSIssues.CSV
ADCSRemediation.CSV
Artefacts/*
Examples/Output/*
Ignore/*
Lib/Core/*
Lib/Default/*
Lib/Standard/*
ReleasedUnpacked/*
Releases/*
Sources/.vs
Sources/*/.vs
Sources/*/obj
Sources/*/bin
Sources/*/*/obj
Sources/*/*/bin
Sources/packages/*
Lib/Default/*
Lib/Standard/*
Lib/Core/*
8 changes: 8 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=827846
// for the documentation about the extensions.json format
"recommendations": [
"editorconfig.editorconfig",
"ms-vscode.PowerShell",
]
}
33 changes: 33 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
// Place your settings in this file to overwrite default and user settings.
{
"[*]": {
"editor.tabSize": 4,
"files.trimTrailingWhitespace": false,
"editor.insertSpaces": true,
"files.insertFinalNewline": true
},
"[markdown]": {
"editor.tabSize": 2,
},
"[json]": {
"editor.tabSize": 2,
},

// Sets the codeformatting options to follow the given indent style in a way that is compatible with PowerShell syntax. For more information about the brace styles please refer to https://github.com/PoshCode/PowerShellPracticeAndStyle/issues/81.
"powershell.codeFormatting.preset": "OTBS",

// Adds a space between a keyword and its associated scriptblock expression.
"powershell.codeFormatting.whitespaceBeforeOpenBrace": true,

// Adds a space between a keyword (if, elseif, while, switch, etc) and its associated conditional expression.
"powershell.codeFormatting.whitespaceBeforeOpenParen": true,

// Adds spaces before and after an operator ('=', '+', '-', etc.).
"powershell.codeFormatting.whitespaceAroundOperator": true,

// Adds a space after a separator (',' and ';').
"powershell.codeFormatting.whitespaceAfterSeparator": true,

// Omnisharp : Enable EditorConfig support
"omnisharp.enableEditorConfigSupport": true
}
18 changes: 12 additions & 6 deletions Build/Build-Module.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
if (Get-Module -Name 'PSPublishModule' -ListAvailable) {
if (Get-Module -Name 'PSPublishModule' -ListAvailable) {
Write-Information 'PSPublishModule is installed.'
} else {
Write-Information 'PSPublishModule is not installed. Attempting installation.'
Expand All @@ -17,12 +17,12 @@ Import-Module -Name PSPublishModule -Force
Build-Module -ModuleName 'Locksmith' {
# Usual defaults as per standard module
$Manifest = [ordered] @{
ModuleVersion = '2023.9'
ModuleVersion = '2023.11'
CompatiblePSEditions = @('Desktop', 'Core')
GUID = 'b1325b42-8dc4-4f17-aa1f-dcb5984ca14a'
Author = 'Jake Hildreth'
Copyright = "(c) 2022 - $((Get-Date).Year). All rights reserved."
Description = 'A tiny tool to identify and remediate common misconfigurations in Active Directory Certificate Services.'
Description = 'A small tool to find and fix common misconfigurations in Active Directory Certificate Services.'
PowerShellVersion = '5.1'
Tags = @('Windows', 'Locksmith', 'CA', 'PKI', 'ActiveDirectory', 'CertificateServices','ADCS')
}
Expand Down Expand Up @@ -50,7 +50,12 @@ Build-Module -ModuleName 'Locksmith' {
New-ConfigurationModule -Type ExternalModule -Name $Module
}

New-ConfigurationModuleSkip -IgnoreFunctionName 'Clear-Host'

# Ignore missing modules or cmdlets during build process
New-ConfigurationModuleSkip -IgnoreFunctionName @('Out-ConsoleGridView') -IgnoreModuleName @('Microsoft.PowerShell.ConsoleGuiTools')

# Tells the script to exclude Out-ConsoleGridView command from functions if the module is not available to be loaded
New-ConfigurationCommand -CommandName @('Out-ConsoleGridView') -ModuleName 'Microsoft.PowerShell.ConsoleGuiTools'

$ConfigurationFormat = [ordered] @{
RemoveComments = $false
Expand Down Expand Up @@ -101,11 +106,12 @@ Build-Module -ModuleName 'Locksmith' {

$PreScriptMerge = {
param (
[int]$Mode
[int]$Mode,
[array]$Scans
)
}

$PostScriptMerge = { Invoke-Locksmith -Mode $Mode }
$PostScriptMerge = { Invoke-Locksmith -Mode $Mode -Scans $Scans }

New-ConfigurationArtefact -Type Packed -Enable -Path "$PSScriptRoot\..\Artefacts\Packed" -ArtefactName '<ModuleName>-v<ModuleVersion>.zip'
New-ConfigurationArtefact -Type Script -Enable -Path "$PSScriptRoot\..\Artefacts\Script" -PreScriptMerge $PreScriptMerge -PostScriptMerge $PostScriptMerge -ScriptName "Invoke-<ModuleName>.ps1"
Expand Down
Loading

0 comments on commit 6d948d4

Please sign in to comment.