mirror of
https://github.com/Micke-K/IntuneManagement.git
synced 2026-11-27 09:22:26 +01:00
Silent and batch runs can now sign in with a GitHub Actions OIDC token instead of a client secret or certificate. With -Federated, the tool requests the token and passes it to MSAL with WithClientAssertion. The access token is reused until it is within five minutes of expiry, so a bulk export signs in once rather than on every Graph request. Secret and certificate sign-in are unchanged. Contributed by @mattskare.
27 lines
519 B
PowerShell
27 lines
519 B
PowerShell
[CmdletBinding(SupportsShouldProcess=$True)]
|
|
param(
|
|
[switch]
|
|
$ShowConsoleWindow,
|
|
[switch]
|
|
$JSonSettings,
|
|
[string]
|
|
$JSonFile,
|
|
[switch]
|
|
$Silent,
|
|
[string]
|
|
$SilentBatchFile = "",
|
|
[string]
|
|
$TenantId,
|
|
[string]
|
|
$AppId,
|
|
[string]
|
|
$Secret,
|
|
[string]
|
|
$Certificate,
|
|
[switch]
|
|
$Federated
|
|
)
|
|
Import-Module ($PSScriptRoot + "\CloudAPIPowerShellManagement.psd1") -Force
|
|
$param = $PSBoundParameters
|
|
Initialize-CloudAPIManagement -View "IntuneGraphAPI" @param
|