diff --git a/CHANGELOG.md b/CHANGELOG.md index 030a3a2..1baca84 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,12 @@ The format is based on and uses the types of changes according to [Keep a Change ## [Unreleased] +### Added + +- Added hash and compress steps to `Export-M365SecurityAuditTable` function. + +## [0.1.21] - 2024-07-01 + ### Fixed - SPO tests formatting and output. diff --git a/README.md b/README.md index e3d4e22..4c04a53 100644 Binary files a/README.md and b/README.md differ diff --git a/docs/index.html b/docs/index.html index 3c65f0f..9dae1e9 100644 Binary files a/docs/index.html and b/docs/index.html differ diff --git a/help/Export-M365SecurityAuditTable.md b/help/Export-M365SecurityAuditTable.md index 858ea30..07eb7cf 100644 --- a/help/Export-M365SecurityAuditTable.md +++ b/help/Export-M365SecurityAuditTable.md @@ -190,10 +190,11 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## INPUTS -### [CISAuditResult[]], [string] +### [CISAuditResult[]] - An array of CISAuditResult objects. +### [string] - A path to a CSV file. ## OUTPUTS -### [PSCustomObject] +### [PSCustomObject] - A custom object containing the path to the zip file and its hash. ## NOTES ## RELATED LINKS diff --git a/helpers/Build-Help.ps1 b/helpers/Build-Help.ps1 index 9dd530c..6bc99f2 100644 --- a/helpers/Build-Help.ps1 +++ b/helpers/Build-Help.ps1 @@ -4,7 +4,7 @@ Import-Module .\output\module\M365FoundationsCISReport\*\*.psd1 <# - $ver = "v0.1.18" + $ver = "v0.1.22" git checkout main git pull origin main git tag -a $ver -m "Release version $ver refactor Update" @@ -59,6 +59,5 @@ Set-Secret -Name "GitHubToken" -Vault ModuleBuildCreds $GalleryApiToken = Get-Secret -Name "GalleryApiToken" -Vault ModuleBuildCreds -AsPlainText $GitHubToken = Get-Secret -Name "GitHubToken" -Vault ModuleBuildCreds -AsPlainText - $GalleryApiToken -$GitHubToken +$GitHubToken \ No newline at end of file diff --git a/source/Public/Export-M365SecurityAuditTable.ps1 b/source/Public/Export-M365SecurityAuditTable.ps1 index 1943c0d..5003275 100644 --- a/source/Public/Export-M365SecurityAuditTable.ps1 +++ b/source/Public/Export-M365SecurityAuditTable.ps1 @@ -221,17 +221,21 @@ function Export-M365SecurityAuditTable { } $fileHashes | Set-Content -Path $hashFilePath $createdFiles += $hashFilePath # Add the hash file to the array + # Create a zip file and add all the created files $zipFilePath = "$ExportPath\$timestamp`_M365FoundationsAudit.zip" Compress-Archive -Path $createdFiles -DestinationPath $zipFilePath + # Remove the original files after they have been added to the zip foreach ($file in $createdFiles) { Remove-Item -Path $file -Force } + # Compute the hash for the zip file and rename it $zipHash = Get-FileHash -Path $zipFilePath -Algorithm SHA256 $newZipFilePath = "$ExportPath\$timestamp`_M365FoundationsAudit_$($zipHash.Hash.Substring(0, 8)).zip" Rename-Item -Path $zipFilePath -NewName $newZipFilePath + # Output the zip file path with hash [PSCustomObject]@{ ZipFilePath = $newZipFilePath diff --git a/source/en-US/M365FoundationsCISReport-help.xml b/source/en-US/M365FoundationsCISReport-help.xml index dce77ce..d9a795e 100644 --- a/source/en-US/M365FoundationsCISReport-help.xml +++ b/source/en-US/M365FoundationsCISReport-help.xml @@ -277,7 +277,15 @@ - [CISAuditResult[]], [string] + [CISAuditResult[]] - An array of CISAuditResult objects. + + + + + + + + [string] - A path to a CSV file. @@ -287,7 +295,7 @@ - [PSCustomObject] + [PSCustomObject] - A custom object containing the path to the zip file and its hash.