fix: Add plurality to approved storage providers parameter for 8.1.1

This commit is contained in:
DrIOS
2024-06-30 10:17:10 -05:00
parent fc9ff57576
commit 20124cdbb5
3 changed files with 12 additions and 12 deletions

View File

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