fix: Manual rebase export

This commit is contained in:
DrIOS
2024-07-02 10:00:26 -05:00
7 changed files with 25 additions and 7 deletions

View File

@@ -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

View File

@@ -277,7 +277,15 @@
<command:inputTypes>
<command:inputType>
<dev:type>
<maml:name>[CISAuditResult[]], [string]</maml:name>
<maml:name>[CISAuditResult[]] - An array of CISAuditResult objects.</maml:name>
</dev:type>
<maml:description>
<maml:para></maml:para>
</maml:description>
</command:inputType>
<command:inputType>
<dev:type>
<maml:name>[string] - A path to a CSV file.</maml:name>
</dev:type>
<maml:description>
<maml:para></maml:para>
@@ -287,7 +295,7 @@
<command:returnValues>
<command:returnValue>
<dev:type>
<maml:name>[PSCustomObject]</maml:name>
<maml:name>[PSCustomObject] - A custom object containing the path to the zip file and its hash.</maml:name>
</dev:type>
<maml:description>
<maml:para></maml:para>