fix: Add plurality to approved storage providers parameter for 8.1.1
This commit is contained in:
@@ -6,7 +6,7 @@ function Invoke-TestFunction {
|
||||
[Parameter(Mandatory = $false)]
|
||||
[string]$DomainName,
|
||||
[Parameter(Mandatory = $false)]
|
||||
[string[]]$ApprovedCloudStorageProvider
|
||||
[string[]]$ApprovedCloudStorageProviders
|
||||
)
|
||||
|
||||
$functionName = $FunctionFile.BaseName
|
||||
@@ -17,8 +17,8 @@ function Invoke-TestFunction {
|
||||
if ('DomainName' -in $functionCmd.Parameters.Keys) {
|
||||
$paramList.DomainName = $DomainName
|
||||
}
|
||||
if ('ApprovedCloudStorageProvider' -in $functionCmd.Parameters.Keys) {
|
||||
$paramList.ApprovedCloudStorageProvider = $ApprovedCloudStorageProvider
|
||||
if ('ApprovedCloudStorageProviders' -in $functionCmd.Parameters.Keys) {
|
||||
$paramList.ApprovedCloudStorageProviders = $ApprovedCloudStorageProviders
|
||||
}
|
||||
# Use splatting to pass parameters
|
||||
Write-Verbose "Running $functionName..."
|
||||
|
@@ -21,7 +21,7 @@
|
||||
Specifies specific recommendations to include in the audit. Accepts an array of recommendation numbers.
|
||||
.PARAMETER SkipRecommendation
|
||||
Specifies specific recommendations to exclude from the audit. Accepts an array of recommendation numbers.
|
||||
.PARAMETER ApprovedCloudStorageProvider
|
||||
.PARAMETER ApprovedCloudStorageProviders
|
||||
Specifies the approved cloud storage providers for the audit. Accepts an array of cloud storage provider names.
|
||||
.PARAMETER DoNotConnect
|
||||
If specified, the cmdlet will not establish a connection to Microsoft 365 services.
|
||||
@@ -185,7 +185,7 @@ function Invoke-M365SecurityAudit {
|
||||
[ValidateSet(
|
||||
'GoogleDrive', 'ShareFile', 'Box', 'DropBox', 'Egnyte'
|
||||
)]
|
||||
[string[]]$ApprovedCloudStorageProvider = @(),
|
||||
[string[]]$ApprovedCloudStorageProviders = @(),
|
||||
|
||||
[Parameter(Mandatory = $false, HelpMessage = "Specifies that the cmdlet will not establish a connection to Microsoft 365 services.")]
|
||||
[switch]$DoNotConnect,
|
||||
@@ -300,7 +300,7 @@ function Invoke-M365SecurityAudit {
|
||||
Write-Progress -Activity "Executing Tests" -Status "Executing $($currentTestIndex) of $($totalTests): $($testFunction.Name)" -PercentComplete (($currentTestIndex / $totalTests) * 100)
|
||||
$functionName = $testFunction.BaseName
|
||||
if ($PSCmdlet.ShouldProcess($functionName, "Execute test")) {
|
||||
$auditResult = Invoke-TestFunction -FunctionFile $testFunction -DomainName $DomainName -ApprovedCloudStorageProvider $ApprovedCloudStorageProvider
|
||||
$auditResult = Invoke-TestFunction -FunctionFile $testFunction -DomainName $DomainName -ApprovedCloudStorageProviders $ApprovedCloudStorageProviders
|
||||
# Add the result to the collection
|
||||
[void]$allAuditResults.Add($auditResult)
|
||||
}
|
||||
|
@@ -3,7 +3,7 @@ function Test-TeamsExternalFileSharing {
|
||||
[OutputType([CISAuditResult])]
|
||||
param (
|
||||
[Parameter(Mandatory = $false)]
|
||||
[string[]]$ApprovedCloudStorageProvider
|
||||
[string[]]$ApprovedCloudStorageProviders
|
||||
)
|
||||
begin {
|
||||
# Dot source the class script if necessary
|
||||
@@ -34,10 +34,10 @@ function Test-TeamsExternalFileSharing {
|
||||
#$clientconfig.AllowDropBox = $false
|
||||
# Define all possible cloud storage providers
|
||||
$allProviders = @("AllowDropBox", "AllowBox", "AllowGoogleDrive", "AllowShareFile", "AllowEgnyte")
|
||||
# If ApprovedCloudStorageProvider is provided, map it to the corresponding settings
|
||||
if ($PSBoundParameters.ContainsKey('ApprovedCloudStorageProvider')) {
|
||||
# If ApprovedCloudStorageProviders is provided, map it to the corresponding settings
|
||||
if ($PSBoundParameters.ContainsKey('ApprovedCloudStorageProviders')) {
|
||||
$approvedProviders = @()
|
||||
foreach ($provider in $ApprovedCloudStorageProvider) {
|
||||
foreach ($provider in $ApprovedCloudStorageProviders) {
|
||||
$approvedProviders += "Allow$provider"
|
||||
}
|
||||
} else {
|
||||
@@ -53,8 +53,8 @@ function Test-TeamsExternalFileSharing {
|
||||
}
|
||||
}
|
||||
$basePassDetails = "All cloud storage services are approved providers"
|
||||
if ($ApprovedCloudStorageProvider) {
|
||||
$basePassDetails = "Approved cloud storage services: $($ApprovedCloudStorageProvider -join ', ')"
|
||||
if ($ApprovedCloudStorageProviders) {
|
||||
$basePassDetails = "Approved cloud storage services: $($ApprovedCloudStorageProviders -join ', ')"
|
||||
}
|
||||
# Create an instance of CISAuditResult and populate it
|
||||
$params = @{
|
||||
|
Reference in New Issue
Block a user