### Install Project Dependencies Source: https://github.com/maester365/maester/blob/main/report/README.md Run this command in the /report folder to install all necessary project dependencies. ```shell npm install ``` -------------------------------- ### Install Project Dependencies Source: https://github.com/maester365/maester/blob/main/website/README.md Installs all necessary project dependencies using npm ci. Ensure you have Node.js and npm installed. ```npm npm ci ``` -------------------------------- ### Install Azure CLI and Bicep Source: https://github.com/maester365/maester/blob/main/website/versioned_docs/version-2.1.0/monitoring/azure-automation-bicep.md Install Azure CLI and Bicep using winget. Ensure you have these tools installed before proceeding with Bicep deployments. ```PowerShell winget install -e --id Microsoft.AzureCLI winget install -e --id Microsoft.Bicep ``` -------------------------------- ### Complete Custom Configuration Example Source: https://github.com/maester365/maester/blob/main/website/versioned_docs/version-2.1.0/configuration/severity-levels.md An example of a `maester-config.json` file that includes both global settings and custom test severity levels. ```json { "GlobalSettings": { "EmergencyAccessAccounts": [ { "UserPrincipalName": "BreakGlass1@contoso.com", "Type": "User" } ] }, "TestSettings": [ { "Id": "MT.1005", "Severity": "Critical" }, { "Id": "CIS.M365.1.1.1", "Severity": "High" }, { "Id": "EIDSCA.AF01", "Severity": "Medium" } ] } ``` -------------------------------- ### Example Usage of Test-AzdoOrganizationProtectAccessToRepository Source: https://github.com/maester365/maester/blob/main/website/versioned_docs/version-2.1.0/commands/Test-AzdoOrganizationProtectAccessToRepository.mdx This example shows how to execute the Test-AzdoOrganizationProtectAccessToRepository command. It returns a boolean value indicating the configuration status. ```powershell Test-AzdoOrganizationProtectAccessToRepository ``` -------------------------------- ### Invoke-MtAzureRequest - Get Subscriptions Source: https://github.com/maester365/maester/blob/main/website/versioned_docs/version-2.1.0/commands/Invoke-MtAzureRequest.mdx This example demonstrates how to retrieve a list of subscriptions using the Invoke-MtAzureRequest cmdlet. It specifies the 'subscriptions' relative URI. ```powershell Invoke-MtAzureRequest -RelativeUri 'subscriptions' ``` -------------------------------- ### Start Local Development Server Source: https://github.com/maester365/maester/blob/main/website/README.md Starts a local development server for live previewing changes. Changes are reflected without server restarts. ```npm npm start ``` -------------------------------- ### Example Usage of Test-MtXspmCriticalCredsOnDevicesWithNonCriticalAccounts Source: https://github.com/maester365/maester/blob/main/website/versioned_docs/version-2.1.0/commands/Test-MtXspmCriticalCredsOnDevicesWithNonCriticalAccounts.mdx This example demonstrates how to call the Test-MtXspmCriticalCredsOnDevicesWithNonCriticalAccounts cmdlet. No parameters are specified, indicating default behavior. ```powershell Test-MtXspmCriticalCredsOnDevicesWithNonCriticalAccounts ``` -------------------------------- ### Example Usage of Test-MtCisaExoAlertSiem Source: https://github.com/maester365/maester/blob/main/website/versioned_docs/version-2.1.0/commands/Test-MtCisaExoAlertSiem.mdx This example shows how to run the Test-MtCisaExoAlertSiem command. It returns null when executed without specific parameters. ```powershell Test-MtCisaExoAlertSiem ``` -------------------------------- ### Example Usage of Test-MtCaEnforceSignInFrequency Source: https://github.com/maester365/maester/blob/main/website/versioned_docs/version-2.1.0/commands/Test-MtCaEnforceSignInFrequency.mdx This example demonstrates how to run the Test-MtCaEnforceSignInFrequency command to check for sign-in frequency policies. No parameters are required for a basic check. ```powershell Test-MtCaEnforceSignInFrequency ``` -------------------------------- ### Install Maester Tests (Default) Source: https://github.com/maester365/maester/blob/main/website/versioned_docs/version-2.1.0/commands/Install-MaesterTests.mdx Installs the latest Maester tests in the current directory. The Pester module will be installed if it's not already present. ```powershell Install-MaesterTests ``` -------------------------------- ### Example Custom Maester Configuration Source: https://github.com/maester365/maester/blob/main/website/versioned_docs/version-2.1.0/configuration/overview.md A complete example of a custom Maester configuration file, demonstrating how to define emergency access accounts and override test severity. ```json { "GlobalSettings": { "EmergencyAccessAccounts": [ { "UserPrincipalName": "BreakGlass1@contoso.com", "Type": "User" }, { "Id": "00000000-0000-0000-0000-000000000000", "Type": "Group" } ] }, "TestSettings": [ { "Id": "MT.1005", "Severity": "Critical" } ] } ``` -------------------------------- ### Install-MaesterTests Source: https://github.com/maester365/maester/blob/main/website/versioned_docs/version-2.1.0/commands/Install-MaesterTests.mdx Installs the latest set of Maester tests in the current directory and installs the Pester module if needed. ```APIDOC ## Install-MaesterTests ### Description Installs the latest ready-made Maester tests built by the Maester team and the required Pester module. ### Syntax ```powershell Install-MaesterTests [[-Path] ] [-SkipPesterCheck] [-ProgressAction ] [] ``` ### Parameters #### -Path The path to install the Maester tests in. Defaults to the current directory. - **Type**: String - **Required**: False - **Position**: 1 - **Default value**: .\ #### -SkipPesterCheck Skips the automatic installation check for Pester. - **Type**: SwitchParameter - **Required**: False - **Position**: Named - **Default value**: False #### -ProgressAction - **Type**: ActionPreference - **Required**: False - **Position**: Named - **Default value**: None ### Examples #### Example 1: Default Installation ```powershell Install-MaesterTests ``` Installs the latest set of Maester tests in the current directory and installs the Pester module if needed. #### Example 2: Specify Installation Path ```powershell Install-MaesterTests -Path .\maester-tests ``` Installs the latest Maester tests in the specified directory and installs the Pester module if needed. #### Example 3: Skip Pester Check ```powershell Install-MaesterTests -SkipPesterCheck ``` Installs the latest Maester tests in the current directory. Skips the check for the required version of Pester. ``` -------------------------------- ### Install Maester and Pester Modules Source: https://github.com/maester365/maester/blob/main/website/versioned_docs/version-2.1.0/installation.md Installs the Pester and Maester PowerShell modules for the current user and sets up the initial test environment. ```powershell Install-Module Pester -SkipPublisherCheck -Force -Scope CurrentUser Install-Module Maester -Scope CurrentUser md maester-tests cd maester-tests Install-MaesterTests ``` -------------------------------- ### Install Maester Tests Locally Source: https://github.com/maester365/maester/blob/main/README.md Installs Maester tests and Pester to a local directory. Navigate to the directory before running this command. ```powershell md ~/maester-tests cd ~/maester-tests Install-MaesterTests ``` -------------------------------- ### Install and Import AzureADSSO PowerShell Module Source: https://github.com/maester365/maester/blob/main/powershell/public/maester/entra/Test-MtEntraIDConnectSsso.md Installs the AzureAD module and imports the AzureADSSO module from the specified path. Ensure you are running these commands on a server with Entra ID Connect installed. ```powershell #Install the AzureAD Module install-module AzureAD #Import the AzureAD SSO module Import-Module "C:\program files\Microsoft Azure Active Directory Connect\AzureADSSO.psd1" ``` -------------------------------- ### Invoke-MaesterBuild Function Example Source: https://github.com/maester365/maester/blob/main/build/maester-optimization-plan.md Example of a PowerShell function adhering to OTBS, Pascal Case, and 4-space indentation. ```powershell function Invoke-MaesterBuild { [CmdletBinding()] param ( [string] $OutputPath ) if (-not (Test-Path -Path $OutputPath)) { New-Item -ItemType Directory -Path $OutputPath | Out-Null } } ``` -------------------------------- ### ConvertFrom-MailAuthenticationRecordDkim Example Source: https://github.com/maester365/maester/blob/main/website/versioned_docs/version-2.1.0/commands/ConvertFrom-MailAuthenticationRecordDkim.mdx This example demonstrates how to use ConvertFrom-MailAuthenticationRecordDkim to retrieve the DKIM record for a given domain. It returns a DKIMRecord object or a failure message. ```powershell ConvertFrom-MailAuthenticationRecordDkim -DomainName "microsoft.com" ``` -------------------------------- ### Test-AzdoOrganizationStageChooser Example Source: https://github.com/maester365/maester/blob/main/website/versioned_docs/version-2.1.0/commands/Test-AzdoOrganizationStageChooser.mdx This example demonstrates how to call the Test-AzdoOrganizationStageChooser cmdlet. It returns a boolean value based on the current Azure DevOps organization's configuration. ```powershell Test-AzdoOrganizationStageChooser ``` -------------------------------- ### Install Optional Azure, Exchange, and Teams Modules Source: https://github.com/maester365/maester/blob/main/website/versioned_docs/version-2.1.0/installation.md Installs the necessary PowerShell modules for Azure, Exchange Online, and Microsoft Teams for running CISA tests. ```powershell Install-Module Az.Accounts, ExchangeOnlineManagement, MicrosoftTeams -Scope CurrentUser ``` -------------------------------- ### Install and Import AzureADSSO PowerShell Module Source: https://github.com/maester365/maester/blob/main/powershell/assets/ReportTemplate.html Installs the AzureAD module and imports the AzureADSSO module. Ensure you are running these commands on an Active Directory management server. ```powershell #Install the AzureAD Module install-module AzureAD #Import the AzureAD SSO module Import-Module "C:\\program files\\Microsoft Azure Active Directory Connect\\AzureADSSO.psd1" ``` -------------------------------- ### Example Usage of Test-MtPimAlertsExists Source: https://github.com/maester365/maester/blob/main/website/versioned_docs/version-2.1.0/commands/Test-MtPimAlertsExists.mdx Demonstrates how to use the Test-MtPimAlertsExists cmdlet to check for a specific PIM alert ('RolesAssignedOutsidePimAlert') within the 'ControlPlane' access level. This example shows how to specify required parameters. ```powershell Test-MtPimAlertsExists -FilteredAccessLevel "ControlPlane" -AlertId "RolesAssignedOutsidePimAlert" ``` -------------------------------- ### Start Development Server Source: https://github.com/maester365/maester/blob/main/report/README.md Execute this command in the /report folder to launch the development server. ```shell npm run dev ``` -------------------------------- ### Get Registrable Domain for a Domain (Different TLD) Source: https://github.com/maester365/maester/blob/main/website/versioned_docs/version-2.1.0/commands/Get-MtRegistrableDomain.mdx This example shows the output when the input is already the registrable domain with a different TLD. ```powershell Get-MtRegistrableDomain -DomainName "example.com" Returns "example.com". ``` -------------------------------- ### Get Registrable Domain for a Different TLD Source: https://github.com/maester365/maester/blob/main/website/versioned_docs/version-2.1.0/commands/Get-MtRegistrableDomain.mdx This example demonstrates retrieving the registrable domain for a domain with a different top-level domain (TLD). ```powershell Get-MtRegistrableDomain -DomainName "sub.example.com" Returns "example.com". ``` -------------------------------- ### Get User Authentication Methods Source: https://github.com/maester365/maester/blob/main/website/versioned_docs/version-2.1.0/commands/Get-MtUserAuthenticationMethod.mdx Retrieves the authentication methods for a specified user. Use the user's email address or GUID as the UserId. ```powershell Get-MtUserAuthenticationMethod -UserId 'john@contoso.com' ``` -------------------------------- ### Initialize Terraform Configuration Source: https://github.com/maester365/maester/blob/main/website/versioned_docs/version-2.1.0/monitoring/azure-devops-terraform.md Run this command to download and install the necessary Terraform providers and modules. ```bash terraform init -upgrade ``` -------------------------------- ### Test-MtCisUserOwnedAppsRestricted Source: https://github.com/maester365/maester/blob/main/website/versioned_docs/version-2.1.0/commands/Test-MtCisUserOwnedAppsRestricted.mdx Checks if users are restricted to install add-ins from the Office Store and start trials on behalf of the organization. This aligns with CIS Microsoft 365 Foundations Benchmark v6.0.1. ```APIDOC ## Test-MtCisUserOwnedAppsRestricted ### Description Checks if users are restricted to install add-ins from the Office Store and start trials on behalf of the organization. ### Method Cmdlet ### Endpoint N/A (PowerShell Cmdlet) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```powershell Test-MtCisUserOwnedAppsRestricted ``` ### Response #### Success Response - **System.Boolean**: Returns true if users cannot install add-ins from the Office Store and start trials on behalf of the organization. #### Response Example ```json true ``` ``` -------------------------------- ### Get Active Members by Role ID Source: https://github.com/maester365/maester/blob/main/website/versioned_docs/version-2.1.0/commands/Get-MtRoleMember.mdx Retrieves only the currently active members for a role specified by its unique GUID. This filters the results to include only those members who are actively assigned. ```powershell Get-MtRoleMember -RoleId "00000000-0000-0000-0000-000000000000" -MemberStatus Active ``` -------------------------------- ### Run Test-MtCaMfaForGuest Cmdlet Source: https://github.com/maester365/maester/blob/main/website/versioned_docs/version-2.1.0/commands/Test-MtCaMfaForGuest.mdx This example shows how to execute the Test-MtCaMfaForGuest cmdlet. No parameters are required for a basic check. ```powershell Test-MtCaMfaForGuest ``` -------------------------------- ### Get Members by Role ID Source: https://github.com/maester365/maester/blob/main/website/versioned_docs/version-2.1.0/commands/Get-MtRoleMember.mdx Retrieves all members (both active and eligible) for a role specified by its unique GUID. This method is useful when the role name is not known or for programmatic access. ```powershell Get-MtRoleMember -RoleId "00000000-0000-0000-0000-000000000000" ``` -------------------------------- ### Test User Restrictions for Office Add-ins Source: https://github.com/maester365/maester/blob/main/website/versioned_docs/version-2.1.0/commands/Test-MtCisUserOwnedAppsRestricted.mdx Run this command to check if users are restricted from installing add-ins from the Office Store and starting trials on behalf of the organization. It returns true if these restrictions are in place. ```powershell Test-MtCisUserOwnedAppsRestricted ``` -------------------------------- ### Update Maester Tests in the Current Directory Source: https://github.com/maester365/maester/blob/main/website/versioned_docs/version-2.1.0/commands/Update-MaesterTests.mdx This command installs the latest set of Maester tests directly into the current working directory. It's a quick way to get the tests set up without specifying a subfolder. ```powershell Update-MaesterTests -Path .\ ``` -------------------------------- ### Install Latest Pester Version Source: https://github.com/maester365/maester/blob/main/website/versioned_docs/version-2.1.0/faq.md Run this command to install the latest version of Pester if an older version conflicts with Maester installation. It installs the module for the current user and bypasses publisher checks. ```powershell Install-Module Pester -Scope CurrentUser -SkipPublisherCheck -Force ``` -------------------------------- ### Install Maester Tests Skipping Pester Check Source: https://github.com/maester365/maester/blob/main/website/versioned_docs/version-2.1.0/commands/Install-MaesterTests.mdx Installs the latest Maester tests in the current directory without checking for or installing the Pester module. Use this if Pester is already installed or not required. ```powershell Install-MaesterTests -SkipPesterCheck ``` -------------------------------- ### Create Custom Maester Configuration File Source: https://github.com/maester365/maester/blob/main/website/versioned_docs/version-2.1.0/configuration/overview.md Command to create the custom configuration file in the specified directory. ```bash # Create the custom config file ./tests/Custom/maester-config.json ``` -------------------------------- ### Example Configuration File Structure Source: https://github.com/maester365/maester/blob/main/website/versioned_docs/version-2.1.0/multi-tenant/configuration.md Illustrates the file structure for shared and tenant-specific Maester configuration files. The system prioritizes tenant-specific files (e.g., `maester-config.a1b2c3d4-e5f6-7890-abcd-ef1234567890.json`) over the default shared file (`maester-config.json`). ```plaintext tests/ maester-config.json # shared default maester-config.a1b2c3d4-e5f6-7890-abcd-ef1234567890.json # Contoso Production maester-config.b2c3d4e5-f6a7-8901-bcde-f12345678901.json # Fabrikam Development ``` -------------------------------- ### Install Maester Tests to Specific Path Source: https://github.com/maester365/maester/blob/main/website/versioned_docs/version-2.1.0/commands/Install-MaesterTests.mdx Installs the latest Maester tests into a specified directory. The Pester module will be installed if it's not already present. ```powershell Install-MaesterTests -Path .\maester-tests ``` -------------------------------- ### Install Maester and ADOPS, Connect to Azure DevOps Source: https://github.com/maester365/maester/blob/main/website/blog/2026-05-01-whats-new-since-maester-2-0/index.md Install the necessary modules and connect to your Azure DevOps organization to enable security tests. Ensure you have the ADOPS PowerShell module installed. ```powershell Install-Module Maester, ADOPS Connect-ADOPS -Organization Invoke-Maester ``` -------------------------------- ### Class Inheritance Setup Source: https://github.com/maester365/maester/blob/main/powershell/assets/ReportTemplate.html Sets up the prototype chain for class inheritance, including constructor and prototype properties. Used by Babel for ES6 class transpilation. ```javascript function Bce(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Super expression must either be null or a function`);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,`prototype`,{writable:!1}),t&&Ow(e,t)} ``` ```javascript function Ow(e,t){return Ow=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Ow(e,t)} ``` -------------------------------- ### Initialize Component Dependencies Source: https://github.com/maester365/maester/blob/main/powershell/assets/ReportTemplate.html Initializes core dependencies like React (DB), and enumerates feature flags (OB) and unmount strategies (kB). This setup is crucial for the component's lifecycle and rendering. ```javascript var DB,OB,kB,AB=o((()=>{DB=u(f(),1),_B(),yB(),OB=(e=>(e[e.None=0]=`None`,e[e.RenderStrategy=1]=`RenderStrategy`,e[e.Static=2]=`Static`,e))(OB||{}),kB=(e=>(e[e.Unmount=0]=`Unmount`,e[e.Hidden=1]=`Hidden`,e))(kB||{})})); ``` -------------------------------- ### Class Inheritance Setup (using prototype) Source: https://github.com/maester365/maester/blob/main/powershell/assets/ReportTemplate.html Sets up inheritance for a class using `Object.create` and `Object.setPrototypeOf`. This is a fundamental mechanism for ES6 class inheritance. ```javascript function xde(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Super expression must either be null or a function`);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,`prototype`,{writable:!1}),t&&JE(e,t)} ``` -------------------------------- ### Install Azure DevOps PowerShell Module Source: https://github.com/maester365/maester/blob/main/website/versioned_docs/version-2.1.0/installation.md Installs the Azure DevOps PowerShell module for the current user. ```powershell Install-Module ADOPS -Scope CurrentUser ``` -------------------------------- ### Standard Build Command Source: https://github.com/maester365/maester/blob/main/build/Build-MaesterModule.md Execute the standard build process for the Maester PowerShell module. ```powershell # Standard build ./build/Build-MaesterModule.ps1 ``` -------------------------------- ### Dockerfile for Maester Container Image Source: https://github.com/maester365/maester/blob/main/website/versioned_docs/version-2.1.0/monitoring/azure-container-app-job.md This Dockerfile sets up the environment for running the `main.ps1` script. It installs necessary PowerShell modules like Az.Accounts, Az.KeyVault, Az.Storage, Microsoft.Graph.Authentication, ExchangeOnlineManagement, and Maester. ```dockerfile FROM mcr.microsoft.com/powershell SHELL ["pwsh","-Command"] COPY main.ps1 / RUN New-Item /maester -ItemType Directory WORKDIR "/maester" RUN Install-Module Az.Accounts -Force RUN Install-Module Az.KeyVault -Force RUN Install-Module Az.Storage -Force RUN Install-Module Microsoft.Graph.Authentication -Force RUN Install-Module ExchangeOnlineManagement -Force RUN Install-Module Maester -Force CMD & /main.ps1 ``` -------------------------------- ### Example Usage of Test-ORCA120_malware Source: https://github.com/maester365/maester/blob/main/website/versioned_docs/version-2.1.0/commands/Test-ORCA120_malware.mdx This example shows how to call the Test-ORCA120_malware command. It returns a boolean value indicating the status. ```powershell Test-ORCA120_malware ``` -------------------------------- ### Run Test-MtXspmAppRegWithPrivilegedRolesAndOwners Source: https://github.com/maester365/maester/blob/main/website/versioned_docs/version-2.1.0/commands/Test-MtXspmAppRegWithPrivilegedRolesAndOwners.mdx Execute the command to check app registrations for delegated ownership by privileged role holders. This command requires no parameters to run. ```powershell Test-MtXspmAppRegWithPrivilegedRolesAndOwners ``` -------------------------------- ### Run Test-MtDeviceRegistrationMfaConflict Source: https://github.com/maester365/maester/blob/main/website/versioned_docs/version-2.1.0/commands/Test-MtDeviceRegistrationMfaConflict.mdx Execute the cmdlet to check for MFA conflicts during device registration. This command requires no parameters. ```powershell Test-MtDeviceRegistrationMfaConflict ``` -------------------------------- ### Example: Sign out using Disconnect-MtMaester Source: https://github.com/maester365/maester/blob/main/website/versioned_docs/version-2.1.0/commands/Disconnect-Maester.mdx This example demonstrates an alternative command, Disconnect-MtMaester, for signing out of a Microsoft Graph session. ```powershell Disconnect-MtMaester ``` -------------------------------- ### Class Inheritance Setup Source: https://github.com/maester365/maester/blob/main/powershell/assets/ReportTemplate.html Sets up inheritance for a class, defining its prototype and static members. This is a core part of ES6 class syntax. ```javascript function gde(e,t,n){return t=qE(t),vde(e,bde()?Reflect.construct(t,n||[],qE(e).constructor):t.apply(e,n))} ``` -------------------------------- ### Configure Tenant App Management Policy (PowerShell) Source: https://github.com/maester365/maester/blob/main/powershell/assets/ReportTemplate.html Provides a sample PowerShell script to configure tenant-wide app management policies. This includes settings for password credentials and key credentials, such as maximum lifetime and restrictions for newly created apps. ```powershell Import-Module Microsoft.Graph.Identity.SignIns $params = @{ isEnabled = $true applicationRestrictions = @{ passwordCredentials = @( @{ restrictionType = "passwordAddition" maxLifetime = $null restrictForAppsCreatedAfterDateTime = [System.DateTime]::Parse("2021-01-01T10:37:00Z") } @{ restrictionType = "passwordLifetime" maxLifetime = "P365D" restrictForAppsCreatedAfterDateTime = [System.DateTime]::Parse("2017-01-01T10:37:00Z") } @{ restrictionType = "symmetricKeyAddition" maxLifetime = $null restrictForAppsCreatedAfterDateTime = [System.DateTime]::Parse("2021-01-01T10:37:00Z") } @{ restrictionType = "customPasswordAddition" maxLifetime = $null restrictForAppsCreatedAfterDateTime = [System.DateTime]::Parse("2015-01-01T10:37:00Z") } @{ restrictionType = "symmetricKeyLifetime" maxLifetime = "P365D" restrictForAppsCreatedAfterDateTime = [System.DateTime]::Parse("2015-01-01T10:37:00Z") } ) keyCredentials = @( @{ restrictionType = "asymmetricKeyLifetime" maxLifetime = "P365D" restrictForAppsCreatedAfterDateTime = [System.DateTime]::Parse("2015-01-01T10:37:00Z") } ) } } Update-MgPolicyDefaultAppManagementPolicy -BodyParameter $params ``` -------------------------------- ### Example: Sign out using Disconnect-MtGraph Source: https://github.com/maester365/maester/blob/main/website/versioned_docs/version-2.1.0/commands/Disconnect-Maester.mdx This example demonstrates how to sign out of a Microsoft Graph session using the Disconnect-MtGraph command. ```powershell Disconnect-MtGraph ``` -------------------------------- ### Iterate or Get Array Slice Source: https://github.com/maester365/maester/blob/main/powershell/assets/ReportTemplate.html Attempts to get an iterator or slice an array. Handles various iterable types. ```javascript function mw(e,t){if(e){if(typeof e== `string` ) return hw(e,t) ; var n=Object.prototype.toString.call(e).slice(8,-1) ; if(n=== `Object` && e.constructor&& (n=e.constructor.name), n=== `Map` || n=== `Set` ) return Array.from(e) ; if(n=== `Arguments` || /^ (?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array $/ .test(n)) return hw(e,t) } } ``` -------------------------------- ### Test Conditional Access for Device Registration/Join Source: https://github.com/maester365/maester/blob/main/website/versioned_docs/version-2.1.0/commands/Test-MtConditionalAccessWhatIf.mdx This example tests Conditional Access policies for a user registering or joining a device to Microsoft Entra. ```powershell Test-MtConditionalAccessWhatIf -UserId '7a6da1c3-616a-416b-a820-cbe4fa8e225e' ` -UserAction 'registerOrJoinDevices' ``` -------------------------------- ### Install Maester PowerShell Module Source: https://github.com/maester365/maester/blob/main/README.md Installs the Maester module for current user. Ensure PowerShellGet is up-to-date if you encounter issues. ```powershell Install-Module -Name Maester -Scope CurrentUser ``` -------------------------------- ### Get All Role Definitions Source: https://github.com/maester365/maester/blob/main/website/versioned_docs/version-2.1.0/commands/Get-MtRole.mdx Use this command to retrieve all available role definitions in your tenant. No parameters are required for this basic usage. ```powershell Get-MtRole ``` -------------------------------- ### Example Usage of Test-ORCA123 Source: https://github.com/maester365/maester/blob/main/website/versioned_docs/version-2.1.0/commands/Test-ORCA123.mdx This example demonstrates how to call the Test-ORCA123 command. It returns a boolean value indicating the result of the test. ```powershell Test-ORCA123 ``` -------------------------------- ### Initialize React Hooks and Effects Source: https://github.com/maester365/maester/blob/main/powershell/assets/ReportTemplate.html Sets up React hooks and effects, including `useState`, `useRef`, and `useLayoutEffect`. This is a common setup for React components that require state management and DOM interaction. ```javascript var cI,lI,uI,yhe=o((()=>{oI(),cI=u(f()),lI=u(f()),uI=typeof document<`u`?lI.useLayoutEffect:lI.useEffect})); ``` -------------------------------- ### GitLab CI/CD Pipeline Configuration Source: https://github.com/maester365/maester/blob/main/website/versioned_docs/version-2.1.0/monitoring/gitlab.md Example `.gitlab-ci.yml` configuration for running Maester tests. Includes artifact definition and job rules for pipeline execution. ```yaml after_script: - pwsh -c 'Write-host "Report can be opened at ($env:CI_JOB_URL/artifacts/external_file/test-results/test-results.html)."' after_script: - pwsh -c 'Write-host "Report can be opened at ($env:CI_JOB_URL/artifacts/external_file/test-results/test-results.html)."' artifacts: when: on_success paths: - test-results/ expire_in: 1 week rules: - if: "$CI_PIPELINE_SOURCE == \"schedule\" || $CI_PIPELINE_SOURCE == \"web\"" ```