Public/TenantConfiguration/Add-BaselineConfiguration.ps1

function Add-BaselineConfiguration {
    param(
        [Parameter(Mandatory)]
        [string]$TenantId
    )

    try {
        Connect-CustomerGraph -CustomerTenantId $TenantId
        
        $SelectedItems = $PolicyTypeSettings | Select-Object Name, Description, Type | Out-ConsoleGridView -Title "Select the desired baseline configuration items you want to add" -OutputMode Multiple


        foreach($SelectedItem in $SelectedItems) {
            Write-Host "Adding baseline configuration item '$($SelectedItem.Name)'.." -ForegroundColor Cyan
            Add-BaselinePolicy -TenantId $TenantId -PolicyType $SelectedItem.Type
            Write-Host "Baseline configuration item '$($SelectedItem.Name)' added." -ForegroundColor Green
        }
    }
    catch {
        throw "Failed to create baseline configuration: $_"
    }
}

#Add-BaselineConfiguration -TenantId "9021bc63-02f9-4f66-b990-88faed382d45"