add: finally block to always disconnect

This commit is contained in:
DrIOS
2024-06-23 18:41:47 -05:00
parent 968e589860
commit 8b91a8c06e

View File

@@ -107,19 +107,19 @@
Output: Output:
What if: Performing the operation "Invoke-M365SecurityAudit" on target "Microsoft 365 environment". What if: Performing the operation "Invoke-M365SecurityAudit" on target "Microsoft 365 environment".
.INPUTS .INPUTS
None. You cannot pipe objects to Invoke-M365SecurityAudit. None. You cannot pipe objects to Invoke-M365SecurityAudit.
.OUTPUTS .OUTPUTS
CISAuditResult[] CISAuditResult[]
The cmdlet returns an array of CISAuditResult objects representing the results of the security audit. The cmdlet returns an array of CISAuditResult objects representing the results of the security audit.
.NOTES .NOTES
- This module is based on CIS benchmarks. - This module is based on CIS benchmarks.
- Governed by the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License. - Governed by the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
- Commercial use is not permitted. This module cannot be sold or used for commercial purposes. - Commercial use is not permitted. This module cannot be sold or used for commercial purposes.
- Modifications and sharing are allowed under the same license. - Modifications and sharing are allowed under the same license.
- For full license details, visit: https://creativecommons.org/licenses/by-nc-sa/4.0/deed.en - For full license details, visit: https://creativecommons.org/licenses/by-nc-sa/4.0/deed.en
- Register for CIS Benchmarks at: https://www.cisecurity.org/cis-benchmarks - Register for CIS Benchmarks at: https://www.cisecurity.org/cis-benchmarks
.LINK .LINK
https://criticalsolutionsnetwork.github.io/M365FoundationsCISReport/#Invoke-M365SecurityAudit https://criticalsolutionsnetwork.github.io/M365FoundationsCISReport/#Invoke-M365SecurityAudit
#> #>
function Invoke-M365SecurityAudit { function Invoke-M365SecurityAudit {
[CmdletBinding(SupportsShouldProcess = $true, DefaultParameterSetName = 'Default')] [CmdletBinding(SupportsShouldProcess = $true, DefaultParameterSetName = 'Default')]