Public/Graph/New-KritTcmMgUser.ps1

<#
.SYNOPSIS
    Krit.TCM wrapper over Microsoft365DSC helper New-MgUser
    (category: Graph, module: M365DSCGraphShim).

.DESCRIPTION
    Auto-scaffolded wave .1514 by New-KritTcmFromM365DscHelpers.ps1.
    Thin delegating passthrough — logic stays in Microsoft365DSC upstream;
    Krit.TCM provides the friendly namespace + citation registration
    for HARD RULE 20 discipline.

    Install-Module Microsoft365DSC -Scope CurrentUser BEFORE calling.

.NOTES
    Wave .1514. Underlying cmdlet: New-MgUser
    Category: Graph
    Module: M365DSCGraphShim
    Params: 146
#>

function New-KritTcmMgUser {
    [CmdletBinding()]
    param(
        [Object] $BodyParameter,
        [String] $ResponseHeadersVariable,
        [String] $AboutMe,
        [SwitchParameter] $AccountEnabled,
        [Object] $Activities,
        [Hashtable] $AdditionalProperties,
        [Object] $AdhocCalls,
        [String] $AgeGroup,
        [Object] $AgreementAcceptances,
        [Object] $AppRoleAssignments,
        [Object] $AssignedLicenses,
        [Object] $AssignedPlans,
        [Object] $Authentication,
        [Object] $AuthorizationInfo,
        [DateTime] $Birthday,
        [String[]] $BusinessPhones,
        [Object] $Calendar,
        [Object] $CalendarGroups,
        [Object] $CalendarView,
        [Object] $Calendars,
        [Object] $Chats,
        [String] $City,
        [Object] $CloudClipboard,
        [Object] $CloudPCs,
        [String] $CompanyName,
        [String] $ConsentProvidedForMinor,
        [Object] $ContactFolders,
        [Object] $Contacts,
        [String] $Country,
        [DateTime] $CreatedDateTime,
        [Object] $CreatedObjects,
        [String] $CreationType,
        [Hashtable] $CustomSecurityAttributes,
        [Object] $DataSecurityAndGovernance,
        [DateTime] $DeletedDateTime,
        [String] $Department,
        [Int32] $DeviceEnrollmentLimit,
        [Object] $DeviceManagementTroubleshootingEvents,
        [Object] $DirectReports,
        [String] $DisplayName,
        [Object] $Drive,
        [Object] $Drives,
        [Object] $EmployeeExperience,
        [DateTime] $EmployeeHireDate,
        [String] $EmployeeId,
        [DateTime] $EmployeeLeaveDateTime,
        [Object] $EmployeeOrgData,
        [String] $EmployeeType,
        [Object] $Events,
        [Object] $Extensions,
        [String] $ExternalUserState,
        [DateTime] $ExternalUserStateChangeDateTime,
        [String] $FaxNumber,
        [Object] $FollowedSites,
        [String] $GivenName,
        [DateTime] $HireDate,
        [String] $Id,
        [Object] $Identities,
        [String] $IdentityParentId,
        [String[]] $ImAddresses,
        [Object] $InferenceClassification,
        [Hashtable] $Insights,
        [String[]] $Interests,
        [SwitchParameter] $IsManagementRestricted,
        [SwitchParameter] $IsResourceAccount,
        [String] $JobTitle,
        [Object] $JoinedTeams,
        [DateTime] $LastPasswordChangeDateTime,
        [String] $LegalAgeGroupClassification,
        [Object] $LicenseAssignmentStates,
        [Object] $LicenseDetails,
        [String] $Mail,
        [Object] $MailFolders,
        [String] $MailNickname,
        [Object] $MailboxSettings,
        [Object] $ManagedAppRegistrations,
        [Object] $ManagedDevices,
        [Object] $Manager,
        [Object] $MemberOf,
        [Object] $Messages,
        [String] $MobilePhone,
        [String] $MySite,
        [Object] $Oauth2PermissionGrants,
        [String] $OfficeLocation,
        [String] $OnPremisesDistinguishedName,
        [String] $OnPremisesDomainName,
        [Object] $OnPremisesExtensionAttributes,
        [String] $OnPremisesImmutableId,
        [DateTime] $OnPremisesLastSyncDateTime,
        [Object] $OnPremisesProvisioningErrors,
        [String] $OnPremisesSamAccountName,
        [String] $OnPremisesSecurityIdentifier,
        [Object] $OnPremisesSyncBehavior,
        [SwitchParameter] $OnPremisesSyncEnabled,
        [String] $OnPremisesUserPrincipalName,
        [Object] $Onenote,
        [Object] $OnlineMeetings,
        [String[]] $OtherMails,
        [Object] $Outlook,
        [Object] $OwnedDevices,
        [Object] $OwnedObjects,
        [String] $PasswordPolicies,
        [Object] $PasswordProfile,
        [String[]] $PastProjects,
        [Object] $People,
        [Object] $PermissionGrants,
        [Object] $Photo,
        [Object] $Photos,
        [Object] $Planner,
        [String] $PostalCode,
        [String] $PreferredDataLocation,
        [String] $PreferredLanguage,
        [String] $PreferredName,
        [Object] $Presence,
        [Object] $Print,
        [Object] $ProvisionedPlans,
        [String[]] $ProxyAddresses,
        [Object] $RegisteredDevices,
        [String[]] $Responsibilities,
        [String[]] $Schools,
        [Object] $ScopedRoleMemberOf,
        [String] $SecurityIdentifier,
        [Object] $ServiceProvisioningErrors,
        [Object] $Settings,
        [SwitchParameter] $ShowInAddressList,
        [Object] $SignInActivity,
        [DateTime] $SignInSessionsValidFromDateTime,
        [String[]] $Skills,
        [Object] $Solutions,
        [Object] $Sponsors,
        [String] $State,
        [String] $StreetAddress,
        [String] $Surname,
        [Object] $Teamwork,
        [Object] $Todo,
        [Object] $TransitiveMemberOf,
        [String] $UsageLocation,
        [String] $UserPrincipalName,
        [String] $UserType,
        [SwitchParameter] $Break,
        [IDictionary] $Headers,
        [Object[]] $HttpPipelineAppend,
        [Object[]] $HttpPipelinePrepend,
        [Uri] $Proxy,
        [PSCredential] $ProxyCredential,
        [SwitchParameter] $ProxyUseDefaultCredentials
    )

    if (-not (Get-Command -Name 'New-MgUser' -ErrorAction SilentlyContinue)) {
        throw '[KritTcm] New-MgUser not available — Install-Module Microsoft365DSC -Scope CurrentUser then re-run'
    }
    try {
        & 'New-MgUser' @PSBoundParameters
    } catch {
        Write-Error ('[KritTcm/New-KritTcmMgUser] ' + 'New-MgUser' + ' failed: ' + $_.Exception.Message)
        throw
    }
}