Public/generated/Invoke-KritTcmM365DscSchemaBridge.ps1
|
<# ·· × × × ··· SirJ's Deaddrop ··· × × × ··· — If you found this, you were meant to — ---------------- A Seriously Kritical™ Production ---------------- [] → (¯`·.¸¸.·´¯) .·´ `·. [] → `·.______________.·´ | +------------------+ | | | Kritical™ | | | | [] [] | | | | | | | | [] [] [] | | | +------------------+ | (._.·´¯`·.¸_) Your last call. And your first move. ★ ☆ ★ +61 1300 274 655 sales at kritical dot net ----------------------------------------------------------------- .COPYRIGHT (c) 2026 Kritical Pty Ltd. All rights reserved. .AUTHOR Joshua Finley <joshua.finley@kritical.net> .COMPANY Kritical Pty Ltd | ABN 39 687 048 086 Level 4 / 60 Moorabool St Geelong VIC 3220 1300 274 655 | sales@kritical.net | https://kritical.net/ .NOTES HARD RULE 13 canonical Kritical branding — do not overlay other agent banners. Auto-generated by Generate-KritTcmFromM365DscSchema.ps1 (.1507o30+). Upstream reference: Microsoft365DSC by Microsoft (MIT). This shim provides literal search-replace equivalence — see Krit.TCM/generated/index.md. #> function Invoke-KritTcmM365DscSchemaBridge { <# .SYNOPSIS Dispatch bridge from auto-generated Krit.TCM Get-* / Test-* / Set-* function to actual Graph endpoint. Populated per-resource in follow-up waves. #> [CmdletBinding()] param( [Parameter(Mandatory)][string]$ResourceName, [Parameter(Mandatory)][string]$Workload, [Parameter(Mandatory)][ValidateSet('Get','Test','Set','New','Remove')][string]$Verb, [hashtable]$CallerParams ) # Try dispatch via the auto-generated endpoint map first. $mapPath = Join-Path $PSScriptRoot '../../../generated/endpoint-map.json' $mapPath = Resolve-Path $mapPath -ErrorAction SilentlyContinue $endpoint = $null if ($mapPath) { try { $map = Get-Content $mapPath.Path -Raw | ConvertFrom-Json if ($map.PSObject.Properties.Name -contains $ResourceName) { $endpoint = $map.$ResourceName } } catch { } } if (-not $endpoint) { return [pscustomobject]@{ ResourceName = $ResourceName Workload = $Workload Verb = $Verb Verdict = 'UNMAPPED' Reason = 'Endpoint-map does not carry a mapping for this resource yet. Follow-up wave will add via Ship-KritTcmEndpointMap.ps1.' CallerParams = $CallerParams } } # Delegate to Krit.EntraId primitive (uses pagination + backoff + retry) if (-not (Get-Module Krit.EntraId)) { $entraPath = Resolve-Path (Join-Path $PSScriptRoot '../../../../KRTPax8ToShopifyConnector/scripts/m365-setup/Krit.EntraId.psm1') -ErrorAction SilentlyContinue if ($entraPath) { Import-Module $entraPath.Path -Force } } switch ($Verb) { 'Get' { $r = Invoke-KritEntraApi -Path $endpoint.Path -UseBeta:$endpoint.UseBeta return [pscustomobject]@{ ResourceName = $ResourceName Workload = $Workload Verb = 'Get' Verdict = 'OK' Endpoint = $endpoint.Path Value = @($r.value) Count = @($r.value).Count } } default { return [pscustomobject]@{ ResourceName = $ResourceName Workload = $Workload Verb = $Verb Verdict = 'VERB-NOT-YET-IMPLEMENTED' Endpoint = $endpoint.Path } } } } |