IntuneScriptLab

0.29.0

Test Intune scripts before Intune does: static rules, a runtime harness, Pester assertions, a Graph
pre-flight over the tenant's deployed scripts and readers for the agent's logs

Minimum PowerShell version

5.1

Installation Options

Copy and Paste the following command to install this package using PowerShellGet More Info

Install-Module -Name IntuneScriptLab -RequiredVersion 0.29.0

Copy and Paste the following command to install this package using Microsoft.PowerShell.PSResourceGet More Info

Install-PSResource -Name IntuneScriptLab -Version 0.29.0

You can deploy this package directly to Azure Automation. Note that deploying packages with dependencies will deploy all the dependencies to Azure Automation. Learn More

Manually download the .nupkg file to your system's default download location. Note that the file won't be unpacked, and won't include any dependencies. Learn More

Owners

Copyright

(c) 2026 Jeffrey Stuhr. All rights reserved.

Package Details

Author(s)

  • Jeffrey Stuhr

Tags

Intune Remediation Win32 PSScriptAnalyzer Lint Endpoint Pester

Functions

Test-IntuneScript Invoke-IntuneDetectionTest Invoke-IntuneRemediationTest Invoke-IntunePlatformScriptTest Invoke-IntuneWin32AppTest Invoke-IntuneRequirementTest Test-IntuneWin32Rule Test-IntuneWin32Requirement Get-IntuneAgentLog Get-IntuneAgentTimeline Export-IntuneAgentDiagnostic Get-IntuneAnalyzerRulePath Test-IntuneDeployedScript Compare-IntuneDeployedScript Get-IntuneScriptHealth Export-IntuneFindingSarif Repair-IntuneScript Test-IntuneAssignmentFilter Assert-HaveIntuneStatus Assert-BeIntuneDetected Assert-NotBeIntuneDetected Assert-HaveIntuneRunState Assert-PassIntuneAnalysis Assert-BeIntuneApplicable Assert-NotBeIntuneApplicable

PSEditions

Desktop Core

Dependencies

This module has no dependencies.

Release Notes

0.29.0 - A remediation that writes to stderr is a script error on the device whatever its exit code:
       RemediationStatus 3, Graph scriptError, the error text attached, no post-detection.
       Invoke-IntuneRemediationTest reported Recurred for that run since round 1; it reports Failed,
       skips the post-detection and warns that the exit code was 0. A detection's stderr still changes
       nothing. IslOutputIssue warns about Write-Error and an unguarded cmdlet in a remediation script,
       with -ErrorAction Stop as the fix. Measured in user context on the lab device with five one-off
       remediations, recorded as round 11 (REM-STDERR-*). See CHANGELOG.md.
0.28.0 - Test-IntuneScript analyzes a script about two and a half times faster, with the syntax tree
       walked once and indexed instead of once per rule; Get-IntuneAgentLog reads a large log
       filtered in a fifth of the time. Repair-IntuneScript takes -Context, -Architecture and
       -EnforceSignatureCheck like Test-IntuneScript, and applies eight more edits: -Force on
       Install-Module and its kin, -ErrorAction SilentlyContinue on a probing cmdlet, exit 1 for an
       exit code Intune reads as 1, $env:ProgramW6432, 'ARM64|AMD64', $PSScriptRoot, a
       Get-Credential -Credential call that returns what it was handed, a Set-ExecutionPolicy or
       #Requires -Version 7 line removed. Test-IntuneDeployedScript judges a device group by its
       member counts rather than its first 20 members; every Graph request is retried on 429, 503
       and 504. Invoke-IntuneDetectionTest, Invoke-IntunePlatformScriptTest and
       Invoke-IntuneRequirementTest take script paths from the pipeline; every result type has a
       format view. The in-box module table is held against the host's Windows PowerShell by a
       test, as the PowerShell 7-only tables are. See CHANGELOG.md.
0.27.0 - Harness: a user-context run started from PowerShell 7 gave the 5.1 host PowerShell 7's
       module path (no Cert: drive, Security cmdlets failing to load); -Credential did not find
       a Microsoft Entra account's session, because Windows names such an account after its
       display name and not its sign-in name; a refused folder grant lost its message under
       -ErrorAction Stop on 5.1. Rules, from a tenth validation round: IslPowerShell7Syntax says
       that a 7-only cmdlet, parameter or -Parallel fails where it stands and the script carries
       on, and flags Out-File -Encoding utf8NoBOM, which was listed and never matched;
       IslInteractiveCall warns instead of erring when Get-Credential -Credential is handed
       something that may be a built credential; IslContextIssue's drive-letter finding is
       Information, since the letter cannot say whether it is a mapped drive.
       Repair-IntuneScript no longer turns 'return 1; exit 1' into '1; exit 0; exit 1' with no
       finding left. Help: what Invoke-ScriptAnalyzer -Severity does with the custom rules. See
       CHANGELOG.md.
Earlier versions, 0.1.0 to 0.26.0: CHANGELOG.md, which ships with the module.

FileList

Version History

Version Downloads Last updated
0.34.0 5 10/15/2026
0.33.0 4 10/15/2026
0.32.0 4 10/14/2026
0.31.0 8 10/9/2026
0.30.0 5 10/8/2026
0.29.0 (current version) 7 10/7/2026
0.28.0 7 10/6/2026
0.27.0 10 10/6/2026
0.26.0 12 9/29/2026
0.25.0 4 9/28/2026
Show less