M365CertAuth.psd1

@{
    # Module manifest for M365CertAuth
    RootModule = 'M365CertAuth.psm1'
    ModuleVersion = '1.2.6'
    GUID = 'a1b2c3d4-e5f6-7890-abcd-ef1234567890'
    Author = 'PowerShell Community'
    CompanyName = 'Open Source'
    Copyright = '(c) 2025 PowerShell Community. All rights reserved.'
    Description = 'Certificate-based authentication module for Microsoft 365 PowerShell modules. Automates certificate creation, app registration, permission assignment, and provides ready-to-use certificates for all M365 services. Features tenant management with secure storage and selection menus. Requires Microsoft Graph PowerShell modules for Azure AD operations.'
    PowerShellVersion = '5.1'
    
    # Required modules
    RequiredModules = @(
        'Microsoft.Graph.Authentication',
        'Microsoft.Graph.Applications', 
        'Microsoft.Graph.Identity.DirectoryManagement',
        'Microsoft.Graph.Sites'
    )
    
    # Functions to export
    FunctionsToExport = @('Get-CertificateForAuth', 'Show-CertificateAuthHelp', 'Get-StoredTenants', 'Show-StoredTenants', 'Remove-StoredTenant', 'Clear-StoredTenants')
    
    # Cmdlets to export
    CmdletsToExport = @()
    
    # Variables to export
    VariablesToExport = @()
    
    # Aliases to export
    AliasesToExport = @()
    
    # Private data
    PrivateData = @{
        PSData = @{
            Tags = @('Microsoft365', 'Azure', 'Certificate', 'Authentication', 'Exchange', 'SharePoint', 'Graph', 'PowerShell', 'TenantManagement', 'MultiTenant')
            LicenseUri = ''
            ProjectUri = ''
            IconUri = ''
            ReleaseNotes = @'
Version 1.2.6
- Added cross-platform compatibility for PowerShell 7 and Windows PowerShell 5.1
- Fixed certificate export issues in PowerShell 7 by using .NET Export() method
- Replaced Export-PfxCertificate cmdlet with version-aware implementation
- Eliminated "Could not export certificate with private key" warning in PowerShell 7
- Maintained backward compatibility with Windows PowerShell 5.1

Version 1.2.5
- Fixed critical null reference error in SharePoint tenant detection
- Implemented proper SharePoint tenant URL detection using Get-MgSite root query
- Replaced unreliable domain pattern matching with direct Microsoft Graph API calls
- Improved error handling and removed complex fallback methods
- Enhanced SharePoint tenant name extraction for accurate admin URL generation

Version 1.2.4
- Fixed tenant storage array conversion issues
- Improved multi-tenant support (up to 20 tenants)
- Enhanced tenant selection menu with count display
- Streamlined authentication flow
- Clean session management to prevent wrong tenant operations

Version 1.2.3
- Removed fallback encryption methods for cleaner, more secure implementation
- Simplified encryption logic with proper assembly loading
- Enhanced help examples to use module-provided values (no more hardcoded placeholders)
- Improved connection examples with actual tenant properties

Version 1.2.2
- Fixed compatibility issue with System.Security.Cryptography.ProtectedData
- Added proper assembly loading for encryption support
- Updated help examples to use actual module-provided values instead of placeholders
- Enhanced connection examples with real tenant information

Version 1.2.1
- Enhanced help documentation with detailed tenant management workflow
- Improved function descriptions and usage examples
- Updated manifest to indicate Microsoft Graph dependencies
- Refined tenant management command documentation

Version 1.2.0
- Added tenant management with secure encrypted storage
- Automatic tenant selection menu for multi-tenant environments
- Certificate-based authentication bypass for stored tenants
- New functions: Get-StoredTenants, Show-StoredTenants, Remove-StoredTenant, Clear-StoredTenants
- Enhanced certificate validation and expiry handling for stored connections
- Supports up to 20 stored tenants with automatic cleanup
- Improved user experience with minimal login prompts

Version 1.1.2
- Removed emojis and glyphs from output for better compatibility across terminals
- Improved console output formatting with standard text characters

Version 1.1.1
- Added SharePointTenantName property for correct SharePoint URL detection
- Enhanced domain detection logic for multi-tenant scenarios

Version 1.1.0
- Added tenant information to return object (TenantName, PrimaryDomain, InitialDomain)
- Enhanced module to provide all necessary tenant context for consuming scripts
- Eliminates need for scripts to call Get-MgDomain themselves

Version 1.0.4
- Code cleanup and optimization
- Removed unnecessary validation checks that caused false warnings
- Streamlined module structure

Version 1.0.3
- Documentation cleanup and version update

Version 1.0.2
- Improved role assignment approach for better compatibility
- Added service principal propagation delay for better reliability
- Made Global Administrator role assignment optional with graceful failure handling
- Enhanced error handling to use warnings instead of hard failures

Version 1.0.1
- Fixed Exchange Online App-Only authentication by adding Exchange Administrator role assignment
- Enhanced role validation for existing app registrations
- Improved error handling for directory role assignments

Version 1.0.0
- Initial release
- Automated certificate creation and management
- App registration with comprehensive permissions
- Support for Exchange Online, SharePoint, Microsoft Graph, Teams, Azure, and Security & Compliance
- Enterprise-grade certificate validation and duplicate detection
- Automatic expired certificate cleanup
- Built-in help system with connection examples
'@

            Prerelease = ''
            RequireLicenseAcceptance = $false
            ExternalModuleDependencies = @('Microsoft.Graph.Authentication', 'Microsoft.Graph.Applications', 'Microsoft.Graph.Identity.DirectoryManagement', 'Microsoft.Graph.Sites')
        }
    }
    
    # Help info
    HelpInfoURI = ''
    
    # Default prefix for commands
    DefaultCommandPrefix = ''
}