From 24b55462d93ed9a66057e05b468fee9986c0038b Mon Sep 17 00:00:00 2001 From: Sam Erde Date: Fri, 13 Dec 2024 15:39:15 -0500 Subject: [PATCH 01/15] Fix typo of 'continuous' --- website/src/components/HomepageFeatures/index.js | 4 ++-- website/src/pages/index.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/website/src/components/HomepageFeatures/index.js b/website/src/components/HomepageFeatures/index.js index d941a4cc..b30dd50b 100644 --- a/website/src/components/HomepageFeatures/index.js +++ b/website/src/components/HomepageFeatures/index.js @@ -24,11 +24,11 @@ const FeatureList = [ ), }, { - title: "Continous monitoring", + title: "Continuous monitoring", Svg: require("@site/static/img/home/feature_monitor.svg").default, description: ( <> - Set up continous monitoring of your tenant configuration using your + Set up continuous monitoring of your tenant configuration using your favorite CI/CD pipeline and alert if any test fails. ), diff --git a/website/src/pages/index.js b/website/src/pages/index.js index 0ea5d3ae..fdfbe7ce 100644 --- a/website/src/pages/index.js +++ b/website/src/pages/index.js @@ -10,7 +10,7 @@ import styles from "./index.module.css"; const textContent = { customTests: ` Write Pester tests that encode your organization's business and security policies.

- Apply modern DevSecOps practices and continously monitor critical aspects of your Microsoft cloud. + Apply modern DevSecOps practices and continuously monitor critical aspects of your Microsoft cloud. `, whatIf: ` Avoid creating loopholes in your conditional access policies and test to see the impact of a policy change before it is applied.

@@ -48,7 +48,7 @@ and when changes are introduced in your Microsoft 365 tenant. Follow the step-by-step guide in the Maester docs to set up an automation account with Workload Identify Federation.`, gitHub: ` -Integrate Maester with GitHub Actions to continously monitor your tenant configuration. +Integrate Maester with GitHub Actions to continuously monitor your tenant configuration.

Build an archive history of Maester test runs against your tenant with the native workflow integration in Maester. From 79571a887998fefe0e3504ffb95cf553c6b46b70 Mon Sep 17 00:00:00 2001 From: Sam Erde Date: Fri, 13 Dec 2024 16:03:04 -0500 Subject: [PATCH 02/15] Add cspell config --- .cspell.json | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .cspell.json diff --git a/.cspell.json b/.cspell.json new file mode 100644 index 00000000..23d9978b --- /dev/null +++ b/.cspell.json @@ -0,0 +1,33 @@ +{ + "import": [ + "@cspell/dict-powershell/cspell-ext.json", + "@cspell/dict-csharp/cspell-ext.json" + ], + "version": "0.2", + "language": "en", + "words": [ + "Maester", + "Docusaurus", + "Entra", + "Contoso" + ], + "ignoreWords": [ + "maester", + "eidsca", + "merill", + "docusaurus" + ], + "patterns": [ + { + "name": "ALL-CAPS-WORDS", + "pattern": "/\b[A-Z0-9]+\b/g", + "description": "Any word in ALL CAPS." + } + ], + "ignoreRegExpList": [ + "ALL-CAPS-WORDS", + "Email", + "github.com/", + "@" + ] +} From 62940d8a1a54b4113fea7be20c4e3d921a901877 Mon Sep 17 00:00:00 2001 From: Sam Erde Date: Fri, 13 Dec 2024 16:07:22 -0500 Subject: [PATCH 03/15] Add ignored words --- .cspell.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.cspell.json b/.cspell.json index 23d9978b..78893836 100644 --- a/.cspell.json +++ b/.cspell.json @@ -15,7 +15,9 @@ "maester", "eidsca", "merill", - "docusaurus" + "docusaurus", + "devcontainers", + "codespaces" ], "patterns": [ { From a8d42c5b6f7867ea2ca80e9e6b9328e90345c417 Mon Sep 17 00:00:00 2001 From: Sam Erde Date: Fri, 13 Dec 2024 16:08:30 -0500 Subject: [PATCH 04/15] Remove trailing whitespace --- powershell/internal/eidsca/Test-MtEidscaAF01.ps1 | 1 - 1 file changed, 1 deletion(-) diff --git a/powershell/internal/eidsca/Test-MtEidscaAF01.ps1 b/powershell/internal/eidsca/Test-MtEidscaAF01.ps1 index 91e45fbd..a812a8b9 100644 --- a/powershell/internal/eidsca/Test-MtEidscaAF01.ps1 +++ b/powershell/internal/eidsca/Test-MtEidscaAF01.ps1 @@ -21,7 +21,6 @@ function Test-MtEidscaAF01 { [OutputType([bool])] param() - $result = Invoke-MtGraphRequest -RelativeUri "policies/authenticationMethodsPolicy/authenticationMethodConfigurations('Fido2')" -ApiVersion beta [string]$tenantValue = $result.state From e1bfcc5f1a3bf2d9e65cacd16ca71601a5c0db7f Mon Sep 17 00:00:00 2001 From: Sam Erde Date: Fri, 13 Dec 2024 16:09:04 -0500 Subject: [PATCH 05/15] Remove trailing whitespace --- powershell/internal/eidsca/Test-MtEidscaAG01.ps1 | 1 - 1 file changed, 1 deletion(-) diff --git a/powershell/internal/eidsca/Test-MtEidscaAG01.ps1 b/powershell/internal/eidsca/Test-MtEidscaAG01.ps1 index 026dd5d8..72753aad 100644 --- a/powershell/internal/eidsca/Test-MtEidscaAG01.ps1 +++ b/powershell/internal/eidsca/Test-MtEidscaAG01.ps1 @@ -21,7 +21,6 @@ function Test-MtEidscaAG01 { [OutputType([bool])] param() - $result = Invoke-MtGraphRequest -RelativeUri "policies/authenticationMethodsPolicy" -ApiVersion beta [string]$tenantValue = $result.policyMigrationState From 9266ec1e469a0daab044f69d9c9e23c3d39f4517 Mon Sep 17 00:00:00 2001 From: Sam Erde Date: Fri, 13 Dec 2024 16:13:49 -0500 Subject: [PATCH 06/15] Remove trailing whitespace and extra lines --- powershell/internal/eidsca/Test-MtEidscaAG03.ps1 | 1 - powershell/internal/eidsca/Test-MtEidscaAM01.ps1 | 1 - powershell/internal/eidsca/Test-MtEidscaAP01.ps1 | 1 - powershell/internal/eidsca/Test-MtEidscaAP04.ps1 | 1 - powershell/internal/eidsca/Test-MtEidscaAP05.ps1 | 1 - powershell/internal/eidsca/Test-MtEidscaAP06.ps1 | 1 - powershell/internal/eidsca/Test-MtEidscaAP07.ps1 | 1 - powershell/internal/eidsca/Test-MtEidscaAP08.ps1 | 1 - powershell/internal/eidsca/Test-MtEidscaAP09.ps1 | 1 - powershell/internal/eidsca/Test-MtEidscaAP10.ps1 | 1 - powershell/internal/eidsca/Test-MtEidscaAP14.ps1 | 1 - powershell/internal/eidsca/Test-MtEidscaAT01.ps1 | 1 - powershell/internal/eidsca/Test-MtEidscaAV01.ps1 | 1 - powershell/internal/eidsca/Test-MtEidscaCR01.ps1 | 1 - powershell/internal/eidsca/Test-MtEidscaPR02.ps1 | 1 - powershell/internal/eidsca/Test-MtEidscaPR05.ps1 | 1 - powershell/internal/eidsca/Test-MtEidscaPR06.ps1 | 1 - powershell/internal/eidsca/Test-MtEidscaST08.ps1 | 1 - powershell/internal/eidsca/Test-MtEidscaST09.ps1 | 1 - powershell/tests/general/PSScriptAnalyzer.Tests.ps1 | 4 ++-- 20 files changed, 2 insertions(+), 21 deletions(-) diff --git a/powershell/internal/eidsca/Test-MtEidscaAG03.ps1 b/powershell/internal/eidsca/Test-MtEidscaAG03.ps1 index 7ecac9cb..ccb3dd12 100644 --- a/powershell/internal/eidsca/Test-MtEidscaAG03.ps1 +++ b/powershell/internal/eidsca/Test-MtEidscaAG03.ps1 @@ -21,7 +21,6 @@ function Test-MtEidscaAG03 { [OutputType([bool])] param() - $result = Invoke-MtGraphRequest -RelativeUri "policies/authenticationMethodsPolicy" -ApiVersion beta [string]$tenantValue = $result.reportSuspiciousActivitySettings.includeTarget.id diff --git a/powershell/internal/eidsca/Test-MtEidscaAM01.ps1 b/powershell/internal/eidsca/Test-MtEidscaAM01.ps1 index e430e915..5a62d126 100644 --- a/powershell/internal/eidsca/Test-MtEidscaAM01.ps1 +++ b/powershell/internal/eidsca/Test-MtEidscaAM01.ps1 @@ -21,7 +21,6 @@ function Test-MtEidscaAM01 { [OutputType([bool])] param() - $result = Invoke-MtGraphRequest -RelativeUri "policies/authenticationMethodsPolicy/authenticationMethodConfigurations('MicrosoftAuthenticator')" -ApiVersion beta [string]$tenantValue = $result.state diff --git a/powershell/internal/eidsca/Test-MtEidscaAP01.ps1 b/powershell/internal/eidsca/Test-MtEidscaAP01.ps1 index e0bdbc38..fbed810f 100644 --- a/powershell/internal/eidsca/Test-MtEidscaAP01.ps1 +++ b/powershell/internal/eidsca/Test-MtEidscaAP01.ps1 @@ -21,7 +21,6 @@ function Test-MtEidscaAP01 { [OutputType([bool])] param() - $result = Invoke-MtGraphRequest -RelativeUri "policies/authorizationPolicy" -ApiVersion beta [string]$tenantValue = $result.allowedToUseSSPR diff --git a/powershell/internal/eidsca/Test-MtEidscaAP04.ps1 b/powershell/internal/eidsca/Test-MtEidscaAP04.ps1 index 6c10ccaf..eba382df 100644 --- a/powershell/internal/eidsca/Test-MtEidscaAP04.ps1 +++ b/powershell/internal/eidsca/Test-MtEidscaAP04.ps1 @@ -21,7 +21,6 @@ function Test-MtEidscaAP04 { [OutputType([bool])] param() - $result = Invoke-MtGraphRequest -RelativeUri "policies/authorizationPolicy" -ApiVersion beta [string]$tenantValue = $result.allowInvitesFrom diff --git a/powershell/internal/eidsca/Test-MtEidscaAP05.ps1 b/powershell/internal/eidsca/Test-MtEidscaAP05.ps1 index 2e3e0570..baee1a6d 100644 --- a/powershell/internal/eidsca/Test-MtEidscaAP05.ps1 +++ b/powershell/internal/eidsca/Test-MtEidscaAP05.ps1 @@ -21,7 +21,6 @@ function Test-MtEidscaAP05 { [OutputType([bool])] param() - $result = Invoke-MtGraphRequest -RelativeUri "policies/authorizationPolicy" -ApiVersion beta [string]$tenantValue = $result.allowedToSignUpEmailBasedSubscriptions diff --git a/powershell/internal/eidsca/Test-MtEidscaAP06.ps1 b/powershell/internal/eidsca/Test-MtEidscaAP06.ps1 index d1323bca..0c8aed65 100644 --- a/powershell/internal/eidsca/Test-MtEidscaAP06.ps1 +++ b/powershell/internal/eidsca/Test-MtEidscaAP06.ps1 @@ -21,7 +21,6 @@ function Test-MtEidscaAP06 { [OutputType([bool])] param() - $result = Invoke-MtGraphRequest -RelativeUri "policies/authorizationPolicy" -ApiVersion beta [string]$tenantValue = $result.allowEmailVerifiedUsersToJoinOrganization diff --git a/powershell/internal/eidsca/Test-MtEidscaAP07.ps1 b/powershell/internal/eidsca/Test-MtEidscaAP07.ps1 index 0ab9f710..b07bf7f4 100644 --- a/powershell/internal/eidsca/Test-MtEidscaAP07.ps1 +++ b/powershell/internal/eidsca/Test-MtEidscaAP07.ps1 @@ -21,7 +21,6 @@ function Test-MtEidscaAP07 { [OutputType([bool])] param() - $result = Invoke-MtGraphRequest -RelativeUri "policies/authorizationPolicy" -ApiVersion beta [string]$tenantValue = $result.guestUserRoleId diff --git a/powershell/internal/eidsca/Test-MtEidscaAP08.ps1 b/powershell/internal/eidsca/Test-MtEidscaAP08.ps1 index db5e43ff..5467a58b 100644 --- a/powershell/internal/eidsca/Test-MtEidscaAP08.ps1 +++ b/powershell/internal/eidsca/Test-MtEidscaAP08.ps1 @@ -21,7 +21,6 @@ function Test-MtEidscaAP08 { [OutputType([bool])] param() - $result = Invoke-MtGraphRequest -RelativeUri "policies/authorizationPolicy" -ApiVersion beta [string]$tenantValue = $result.permissionGrantPolicyIdsAssignedToDefaultUserRole | Sort-Object -Descending | select-object -first 1 diff --git a/powershell/internal/eidsca/Test-MtEidscaAP09.ps1 b/powershell/internal/eidsca/Test-MtEidscaAP09.ps1 index dfb4bd12..e1c772b5 100644 --- a/powershell/internal/eidsca/Test-MtEidscaAP09.ps1 +++ b/powershell/internal/eidsca/Test-MtEidscaAP09.ps1 @@ -21,7 +21,6 @@ function Test-MtEidscaAP09 { [OutputType([bool])] param() - $result = Invoke-MtGraphRequest -RelativeUri "policies/authorizationPolicy" -ApiVersion beta [string]$tenantValue = $result.allowUserConsentForRiskyApps diff --git a/powershell/internal/eidsca/Test-MtEidscaAP10.ps1 b/powershell/internal/eidsca/Test-MtEidscaAP10.ps1 index 48c61153..99696c1a 100644 --- a/powershell/internal/eidsca/Test-MtEidscaAP10.ps1 +++ b/powershell/internal/eidsca/Test-MtEidscaAP10.ps1 @@ -21,7 +21,6 @@ function Test-MtEidscaAP10 { [OutputType([bool])] param() - $result = Invoke-MtGraphRequest -RelativeUri "policies/authorizationPolicy" -ApiVersion beta [string]$tenantValue = $result.defaultUserRolePermissions.allowedToCreateApps diff --git a/powershell/internal/eidsca/Test-MtEidscaAP14.ps1 b/powershell/internal/eidsca/Test-MtEidscaAP14.ps1 index 9779f074..4c6c0972 100644 --- a/powershell/internal/eidsca/Test-MtEidscaAP14.ps1 +++ b/powershell/internal/eidsca/Test-MtEidscaAP14.ps1 @@ -21,7 +21,6 @@ function Test-MtEidscaAP14 { [OutputType([bool])] param() - $result = Invoke-MtGraphRequest -RelativeUri "policies/authorizationPolicy" -ApiVersion beta [string]$tenantValue = $result.defaultUserRolePermissions.allowedToReadOtherUsers diff --git a/powershell/internal/eidsca/Test-MtEidscaAT01.ps1 b/powershell/internal/eidsca/Test-MtEidscaAT01.ps1 index 5a29b9d4..5cfc701f 100644 --- a/powershell/internal/eidsca/Test-MtEidscaAT01.ps1 +++ b/powershell/internal/eidsca/Test-MtEidscaAT01.ps1 @@ -21,7 +21,6 @@ function Test-MtEidscaAT01 { [OutputType([bool])] param() - $result = Invoke-MtGraphRequest -RelativeUri "policies/authenticationMethodsPolicy/authenticationMethodConfigurations('TemporaryAccessPass')" -ApiVersion beta [string]$tenantValue = $result.state diff --git a/powershell/internal/eidsca/Test-MtEidscaAV01.ps1 b/powershell/internal/eidsca/Test-MtEidscaAV01.ps1 index 1c88e3a7..1ec3cc79 100644 --- a/powershell/internal/eidsca/Test-MtEidscaAV01.ps1 +++ b/powershell/internal/eidsca/Test-MtEidscaAV01.ps1 @@ -21,7 +21,6 @@ function Test-MtEidscaAV01 { [OutputType([bool])] param() - $result = Invoke-MtGraphRequest -RelativeUri "policies/authenticationMethodsPolicy/authenticationMethodConfigurations('Voice')" -ApiVersion beta [string]$tenantValue = $result.state diff --git a/powershell/internal/eidsca/Test-MtEidscaCR01.ps1 b/powershell/internal/eidsca/Test-MtEidscaCR01.ps1 index 54292359..a8fbac20 100644 --- a/powershell/internal/eidsca/Test-MtEidscaCR01.ps1 +++ b/powershell/internal/eidsca/Test-MtEidscaCR01.ps1 @@ -21,7 +21,6 @@ function Test-MtEidscaCR01 { [OutputType([bool])] param() - $result = Invoke-MtGraphRequest -RelativeUri "policies/adminConsentRequestPolicy" -ApiVersion beta [string]$tenantValue = $result.isEnabled diff --git a/powershell/internal/eidsca/Test-MtEidscaPR02.ps1 b/powershell/internal/eidsca/Test-MtEidscaPR02.ps1 index 4e2827c7..735d6b37 100644 --- a/powershell/internal/eidsca/Test-MtEidscaPR02.ps1 +++ b/powershell/internal/eidsca/Test-MtEidscaPR02.ps1 @@ -21,7 +21,6 @@ function Test-MtEidscaPR02 { [OutputType([bool])] param() - $result = Invoke-MtGraphRequest -RelativeUri "settings" -ApiVersion beta [string]$tenantValue = $result.values | where-object name -eq 'EnableBannedPasswordCheckOnPremises' | select-object -expand value diff --git a/powershell/internal/eidsca/Test-MtEidscaPR05.ps1 b/powershell/internal/eidsca/Test-MtEidscaPR05.ps1 index 7a30ac1b..4da1a145 100644 --- a/powershell/internal/eidsca/Test-MtEidscaPR05.ps1 +++ b/powershell/internal/eidsca/Test-MtEidscaPR05.ps1 @@ -21,7 +21,6 @@ function Test-MtEidscaPR05 { [OutputType([bool])] param() - $result = Invoke-MtGraphRequest -RelativeUri "settings" -ApiVersion beta [int]$tenantValue = $result.values | where-object name -eq 'LockoutDurationInSeconds' | select-object -expand value diff --git a/powershell/internal/eidsca/Test-MtEidscaPR06.ps1 b/powershell/internal/eidsca/Test-MtEidscaPR06.ps1 index a971db55..828e94ca 100644 --- a/powershell/internal/eidsca/Test-MtEidscaPR06.ps1 +++ b/powershell/internal/eidsca/Test-MtEidscaPR06.ps1 @@ -21,7 +21,6 @@ function Test-MtEidscaPR06 { [OutputType([bool])] param() - $result = Invoke-MtGraphRequest -RelativeUri "settings" -ApiVersion beta [int]$tenantValue = $result.values | where-object name -eq 'LockoutThreshold' | select-object -expand value diff --git a/powershell/internal/eidsca/Test-MtEidscaST08.ps1 b/powershell/internal/eidsca/Test-MtEidscaST08.ps1 index 523ee638..c0ecd33d 100644 --- a/powershell/internal/eidsca/Test-MtEidscaST08.ps1 +++ b/powershell/internal/eidsca/Test-MtEidscaST08.ps1 @@ -21,7 +21,6 @@ function Test-MtEidscaST08 { [OutputType([bool])] param() - $result = Invoke-MtGraphRequest -RelativeUri "settings" -ApiVersion beta [string]$tenantValue = $result.values | where-object name -eq 'AllowGuestsToBeGroupOwner' | select-object -expand value diff --git a/powershell/internal/eidsca/Test-MtEidscaST09.ps1 b/powershell/internal/eidsca/Test-MtEidscaST09.ps1 index e5ccd5e2..06159718 100644 --- a/powershell/internal/eidsca/Test-MtEidscaST09.ps1 +++ b/powershell/internal/eidsca/Test-MtEidscaST09.ps1 @@ -21,7 +21,6 @@ function Test-MtEidscaST09 { [OutputType([bool])] param() - $result = Invoke-MtGraphRequest -RelativeUri "settings" -ApiVersion beta [string]$tenantValue = $result.values | where-object name -eq 'AllowGuestsToAccessGroups' | select-object -expand value diff --git a/powershell/tests/general/PSScriptAnalyzer.Tests.ps1 b/powershell/tests/general/PSScriptAnalyzer.Tests.ps1 index 5e4f72f4..0bc86650 100644 --- a/powershell/tests/general/PSScriptAnalyzer.Tests.ps1 +++ b/powershell/tests/general/PSScriptAnalyzer.Tests.ps1 @@ -19,7 +19,7 @@ Describe 'Invoking PSScriptAnalyzer against commandbase' -ForEach @{ commandFile } # The next Context blocks are kinda duplicate, but helps us document both - # which files and which rules where evaluated without running every rule for every file + # which files and which rules where evaluated without running every rule for every file Context 'Analyzing rule <_.RuleName>' -ForEach $scriptAnalyzerRules { BeforeAll { $rule = $_ @@ -48,4 +48,4 @@ Describe 'Invoking PSScriptAnalyzer against commandbase' -ForEach @{ commandFile @($failedRules).RuleName | Should -BeNullOrEmpty } } -} \ No newline at end of file +} From 0a0754b6c7015a472a690a1c457b2023a34a334f Mon Sep 17 00:00:00 2001 From: Sam Erde Date: Fri, 13 Dec 2024 16:15:01 -0500 Subject: [PATCH 07/15] Fix typo in received --- powershell/public/Send-MtMail.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/powershell/public/Send-MtMail.ps1 b/powershell/public/Send-MtMail.ps1 index 1df516aa..69e2914c 100644 --- a/powershell/public/Send-MtMail.ps1 +++ b/powershell/public/Send-MtMail.ps1 @@ -53,7 +53,7 @@ function Send-MtMail { # Developer guide for editing the html report. - Authoring of the email template is done using Word. Open /powershell/assets/EmailTemplate.docx and make changes as needed - Select all and copy/paste the content into a new email in Outlook and send it to yourself - - When the email is recieved, view the source (either through Graph API, View Source in Outlook for Mac or save as .eml and open in a text editor) + - When the email is received, view the source (either through Graph API, View Source in Outlook for Mac or save as .eml and open in a text editor) - Copy the source (..) and paste it into the /powershell/assets/EmailTemplate.html file in the assets folder - Search for cid:image in the html and update the -replace commands in the script below. #> @@ -158,4 +158,4 @@ function Send-MtMail { else { Invoke-MgGraphRequest -Method POST -Uri $sendMailUri -Body $mailRequestBody } -} \ No newline at end of file +} From 12a8f805009216705450e5dc77bc4a07ac37e2cd Mon Sep 17 00:00:00 2001 From: Sam Erde Date: Fri, 13 Dec 2024 16:16:07 -0500 Subject: [PATCH 08/15] Add words and ignoreWords --- .cspell.json | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.cspell.json b/.cspell.json index 78893836..09d8b949 100644 --- a/.cspell.json +++ b/.cspell.json @@ -9,7 +9,8 @@ "Maester", "Docusaurus", "Entra", - "Contoso" + "Contoso", + "SSPR" ], "ignoreWords": [ "maester", @@ -17,7 +18,8 @@ "merill", "docusaurus", "devcontainers", - "codespaces" + "codespaces", + "multifactor" ], "patterns": [ { From b49a47d2a851e1c2d902bba014ec9c9167619e6d Mon Sep 17 00:00:00 2001 From: Sam Erde Date: Fri, 13 Dec 2024 16:17:33 -0500 Subject: [PATCH 09/15] Fix typo in manifest --- .github/workflows/get-version.ps1 | 8 ++++---- .github/workflows/minor-version-update.ps1 | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/get-version.ps1 b/.github/workflows/get-version.ps1 index 3558245a..3035fd41 100644 --- a/.github/workflows/get-version.ps1 +++ b/.github/workflows/get-version.ps1 @@ -4,14 +4,14 @@ Param( [string]$ModuleRoot = "$($env:GITHUB_WORKSPACE)/powershell" ) -$ManfifestPath = "$($ModuleRoot)/Maester.psd1" +$ManifestPath = "$($ModuleRoot)/Maester.psd1" -if ( -not (Test-Path $ManfifestPath )) { - Write-Error "Could not find PowerShell module manifest ($ManfifestPath)" +if ( -not (Test-Path $ManifestPath )) { + Write-Error "Could not find PowerShell module manifest ($ManifestPath)" throw } else { # Get the current version of the module from the module manifest - $Version = (Test-ModuleManifest $ManfifestPath).Version + $Version = (Test-ModuleManifest $ManifestPath).Version $Version = '{0}.{1}.{2}' -f $Version.Major, $Version.Minor, $Version.Build } diff --git a/.github/workflows/minor-version-update.ps1 b/.github/workflows/minor-version-update.ps1 index 56843656..c934a045 100644 --- a/.github/workflows/minor-version-update.ps1 +++ b/.github/workflows/minor-version-update.ps1 @@ -7,10 +7,10 @@ Param( [switch]$preview = $false ) -$ManfifestPath = "$($ModuleRoot)/Maester.psd1" +$ManifestPath = "$($ModuleRoot)/Maester.psd1" -if ( -not (Test-Path $ManfifestPath )) { - Write-Error "Could not find PowerShell module manifest ($ManfifestPath)" +if ( -not (Test-Path $ManifestPath )) { + Write-Error "Could not find PowerShell module manifest ($ManifestPath)" throw } else { # Get the current version of the module from the PowerShell gallery @@ -42,7 +42,7 @@ if ( -not (Test-Path $ManfifestPath )) { $previewLabel = if ($preview) { '-preview' } else { '' } - Update-ModuleManifest -Path $ManfifestPath -ModuleVersion $NewVersion -FunctionsToExport $FunctionNames -Prerelease $previewLabel + Update-ModuleManifest -Path $ManifestPath -ModuleVersion $NewVersion -FunctionsToExport $FunctionNames -Prerelease $previewLabel } $NewVersion += $previewLabel From b5c85fe5975b8e18caecb976c58c5ca690b611d8 Mon Sep 17 00:00:00 2001 From: Sam Erde Date: Fri, 13 Dec 2024 16:22:00 -0500 Subject: [PATCH 10/15] Fix typo in folder --- build/eidsca/Update-EidscaTests.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build/eidsca/Update-EidscaTests.ps1 b/build/eidsca/Update-EidscaTests.ps1 index 286b45b9..9da80d32 100644 --- a/build/eidsca/Update-EidscaTests.ps1 +++ b/build/eidsca/Update-EidscaTests.ps1 @@ -20,7 +20,7 @@ param ( # Folder where control functions should be generated [string] $PowerShellFunctionsPath = "$PSScriptRoot/../../powershell/internal/eidsca", - # Foldere where the public function should be generated + # Folder where the public function should be generated [string] $PublicFunctionPath = "$PSScriptRoot/../../powershell/public/eidsca", # Control name to filter on @@ -481,4 +481,4 @@ BeforeDiscovery { $output = $output.Replace('',($Discovery | Out-String)) $output += $sb.ToString() -$output | Out-File $TestFilePath -Encoding utf8 \ No newline at end of file +$output | Out-File $TestFilePath -Encoding utf8 From 339d21a9888f55e2810cf741c19f0a1c65c995aa Mon Sep 17 00:00:00 2001 From: Sam Erde Date: Fri, 13 Dec 2024 16:23:34 -0500 Subject: [PATCH 11/15] Fix typo in transferred --- build/CommonFunctions.psm1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build/CommonFunctions.psm1 b/build/CommonFunctions.psm1 index 042ed678..53600b21 100644 --- a/build/CommonFunctions.psm1 +++ b/build/CommonFunctions.psm1 @@ -291,7 +291,7 @@ function Use-StartBitsTransfer { # Specifies the credentials to use to authenticate the user at the proxy [Parameter(Mandatory = $false, Position = 6)] [pscredential] $ProxyCredential, - # Returns an object representing transfered item. + # Returns an object representing transferred item. [Parameter(Mandatory = $false)] [switch] $PassThru ) @@ -304,7 +304,7 @@ function Use-StartBitsTransfer { if (!$Destination) { $Destination = (Get-Location).ProviderPath } if (![System.IO.Path]::HasExtension($Destination)) { $Destination = Join-Path $Destination (Split-Path $Source -Leaf) } - if (Test-Path $Destination) { Write-Verbose ('The Source [{0}] was not transfered to Destination [{0}] because it already exists.' -f $Source, $Destination) } + if (Test-Path $Destination) { Write-Verbose ('The Source [{0}] was not transferred to Destination [{0}] because it already exists.' -f $Source, $Destination) } else { Write-Verbose ('Downloading Source [{0}] to Destination [{1}]' -f $Source, $Destination); Start-BitsTransfer $Source $Destination @paramStartBitsTransfer From ed697d967683092baf8720d483ab3a132d1d2234 Mon Sep 17 00:00:00 2001 From: Sam Erde Date: Fri, 13 Dec 2024 16:25:30 -0500 Subject: [PATCH 12/15] Proper case for PSModulePath --- build/Launch-PSModule.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build/Launch-PSModule.ps1 b/build/Launch-PSModule.ps1 index 9de4c65e..025b196e 100644 --- a/build/Launch-PSModule.ps1 +++ b/build/Launch-PSModule.ps1 @@ -28,8 +28,8 @@ if ($NoNewWindow) { [scriptblock] $ScriptBlock = { param ([string]$ModulePath, [string]$PSModuleCacheDirectory, [scriptblock]$PostImportScriptBlock) ## Reset PSModulePath environment variable to default value because starting powershell.exe from pwsh.exe (or vice versa) will inherit environment variables for the wrong version of PowerShell. - $PSModulePathDefault = [System.Management.Automation.ModuleIntrinsics]::GetModulePath($null, [System.Environment]::GetEnvironmentVariable('PSMODULEPATH', [EnvironmentVariableTarget]::Machine), [System.Environment]::GetEnvironmentVariable('PSMODULEPATH', [EnvironmentVariableTarget]::User)) - [Environment]::SetEnvironmentVariable("PSMODULEPATH", $PSModulePathDefault) + $PSModulePathDefault = [System.Management.Automation.ModuleIntrinsics]::GetModulePath($null, [System.Environment]::GetEnvironmentVariable('PSModulePath', [EnvironmentVariableTarget]::Machine), [System.Environment]::GetEnvironmentVariable('PSModulePath', [EnvironmentVariableTarget]::User)) + [Environment]::SetEnvironmentVariable("PSModulePath", $PSModulePathDefault) ## Add PSModuleCacheDirectory to PSModulePath environment variable if (!$env:PSModulePath.Contains($PSModuleCacheDirectory)) { $env:PSModulePath += '{0}{1}' -f [IO.Path]::PathSeparator, $PSModuleCacheDirectory } ## Import Module and Execute Post-Import ScriptBlock From 292e71b46caf1e3e9ba64f5cbfa15057bbd8b8ac Mon Sep 17 00:00:00 2001 From: Sam Erde Date: Fri, 13 Dec 2024 16:27:01 -0500 Subject: [PATCH 13/15] Fix typo in without --- build/Update-CommandReference.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build/Update-CommandReference.ps1 b/build/Update-CommandReference.ps1 index 5fa894ba..3ee81b90 100644 --- a/build/Update-CommandReference.ps1 +++ b/build/Update-CommandReference.ps1 @@ -15,7 +15,7 @@ Import-Module DnsClient $commandsIndexFile = "./website/docs/commands/readme.md" $readmeContent = Get-Content $commandsIndexFile # Backup the readme.md since it will be deleted by New-DocusaurusHelp -# Get all the filenames in the ./powershell/internal folder wihtout the extension +# Get all the filenames in the ./powershell/internal folder without the extension $internalCommands = Get-ChildItem ./powershell/internal -Filter *.ps1 | ForEach-Object { $_.BaseName } New-DocusaurusHelp -Module ./powershell/Maester.psm1 -DocsFolder ./website/docs -NoPlaceHolderExamples -EditUrl https://github.com/maester365/maester/blob/main/powershell/public/ -Exclude $internalCommands @@ -31,4 +31,4 @@ foreach ($file in $cmdMarkdownFiles) { } } -Set-Content $commandsIndexFile $readmeContent # Restore the readme content \ No newline at end of file +Set-Content $commandsIndexFile $readmeContent # Restore the readme content From eb8c553f6dd57b9ca652beae319091d2fdf2b207 Mon Sep 17 00:00:00 2001 From: Sam Erde Date: Fri, 13 Dec 2024 16:29:53 -0500 Subject: [PATCH 14/15] Add ignored words --- .cspell.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.cspell.json b/.cspell.json index 09d8b949..777ee042 100644 --- a/.cspell.json +++ b/.cspell.json @@ -19,7 +19,9 @@ "docusaurus", "devcontainers", "codespaces", - "multifactor" + "multifactor", + "Dmarc", + "Siem" ], "patterns": [ { From 3fd243afe55c440405e0e84022a779f2b3042ed7 Mon Sep 17 00:00:00 2001 From: Sam Erde Date: Fri, 13 Dec 2024 16:34:35 -0500 Subject: [PATCH 15/15] Add words and ignoredwords --- .cspell.json | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.cspell.json b/.cspell.json index 777ee042..a290feb8 100644 --- a/.cspell.json +++ b/.cspell.json @@ -10,7 +10,8 @@ "Docusaurus", "Entra", "Contoso", - "SSPR" + "SSPR", + "passwordless" ], "ignoreWords": [ "maester", @@ -21,7 +22,10 @@ "codespaces", "multifactor", "Dmarc", - "Siem" + "Siem", + "pscustomobject", + "psobject", + "testresults" ], "patterns": [ {