Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>Intune App Sandbox ExtensionNew to Visual Studio Code? Get it now.
Intune App Sandbox Extension

Intune App Sandbox Extension

Maciej Horbacz

|
119 installs
| (0) | Free
VS Code extension for packaging Win32 apps using IntuneWinAppUtil.exe
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Intune Win32 App Packager

A Visual Studio Code extension that simplifies packaging Win32 applications using Microsoft's IntuneWinAppUtil.exe tool. This extension adds a convenient context menu item to the Explorer view, allowing you to quickly package folders for Intune deployment.

Features

  • Explorer Context Menu Integration: Right-click any folder in VS Code Explorer to access the packaging command
  • Sandbox Testing: Right-click .intunewin files to test them in a sandbox environment
  • First-Run Configuration: Automatically prompts to configure IntuneWinAppUtil.exe path when first activated
  • Smart Script Detection: Automatically determines the appropriate script file based on folder naming conventions:
    • Folders ending with PSADT: Uses Deploy-Application.exe
    • Folders ending with PSADTv4: Uses Invoke-AppDeployToolkit.exe
    • Other folders: Uses {FolderName}.ps1
  • Configurable Tool Paths: Set paths to IntuneWinAppUtil.exe and sandbox test script in extension settings
  • Packaging From Any Location: Packs from a short temporary copy, so folders in deep OneDrive/SharePoint libraries, folders with read-only files and paths longer than 260 characters work
  • Reliable Results: Success is reported only when a new .intunewin was produced; the previous package is replaced only after that
  • Packaging Log: IntuneWinAppUtil output is written to the "Intune App Packaging" output channel
  • Comprehensive Error Handling: Clear notifications for success, warnings, and errors with action buttons
  • Quiet Operation: Uses the -q flag for silent packaging
  • Easy Configuration Access: Configure paths via Command Palette or error dialog buttons

Requirements

  • Visual Studio Code 1.74.0 or higher
  • Microsoft IntuneWinAppUtil.exe (download from Microsoft Win32 Content Prep Tool)

Installation

  1. Install the extension from the VS Code Marketplace
  2. On first activation, the extension will prompt you to configure the IntuneWinAppUtil.exe path
  3. Choose "Configure Now" to set the path immediately, or "Download Tool" to get IntuneWinAppUtil.exe first

Alternative Configuration Methods

  • Command Palette: Press Ctrl+Shift+P and type "Configure IntuneWinAppUtil Path"
  • Manual Settings: Open VS Code Settings (Ctrl+,) → Search for "Intune Win32 App Packager" → Set the full path

Usage

Packaging Folders

  1. Right-click on any folder in the VS Code Explorer
  2. Select "Pack folder with IntuneWinAppUtil" from the context menu
  3. The extension will:
    • Determine the appropriate script file based on the folder name (packaging fails if it does not exist)
    • Copy the folder to a temporary folder under %TEMP% (the previous <setup>.intunewin is left out)
    • Execute IntuneWinAppUtil.exe with the correct parameters on that copy
    • Move the new <setup>.intunewin into the folder, replacing the previous one
    • Show progress and result notifications; use Show Log on errors for the full tool output

The source folder is never modified apart from the .intunewin file. Files in OneDrive that are available online only are downloaded while being copied.

Why a temporary copy

IntuneWinAppUtil.exe is not long-path aware: any file path of 260 or more characters fails the whole package. Libraries synced from SharePoint (C:\Users\<user>\<Company>\<Site> - <Library>\...) easily reach that limit, so packing in place depends on where each person synced the library. The copy has a short path (%TEMP%\iwp-xxxxxx\s\...), which leaves room for the longest path inside the package regardless of where the folder lives. If a path inside the package is still too long, packaging stops before running the tool and names the file to shorten.

The copy also clears the read-only attribute (PSADT marks its module files read-only), so IntuneWinAppUtil can process them without changing the source folder. IntuneWinAppUtil exits with code 0 even after reporting an ERROR, so the extension checks that the package was actually created.

Testing .intunewin Files

  1. Right-click on any .intunewin file in the VS Code Explorer
  2. Select "Run test in Sandbox" or "Run test user context" from the context menu
  3. The extension will:
    • Execute the configured Invoke-Test.ps1 script with the .intunewin file as parameter
    • Add the -RunAsUser switch when running in user context
    • Show progress and result notifications from the sandbox test

Configuration

Setting Description Default
intuneWin32Packager.intuneWinAppUtilPath Full path to IntuneWinAppUtil.exe ""
intuneWin32Packager.sandboxTestScriptPath Full path to Invoke-Test.ps1 script for sandbox testing "C:\\SandboxEnvironment\\bin\\Invoke-Test.ps1"

Command Line Arguments

Packaging Command

The extension runs the following command on the temporary copy:

IntuneWinAppUtil.exe -c "%TEMP%\iwp-xxxxxx\s" -s "%TEMP%\iwp-xxxxxx\s\<scriptPath>" -o "%TEMP%\iwp-xxxxxx\o" -q

Where:

  • -c: Source folder containing the app files
  • -s: Setup file (script) to run
  • -o: Output folder for the .intunewin file (moved into the original folder afterwards)
  • -q: Quiet mode (no prompts)

Sandbox Testing Command

The extension builds the following command for sandbox testing:

C:\Windows\system32\WindowsPowerShell\v1.0\powershell.exe -executionpolicy bypass -command "& 'C:\SandboxEnvironment\bin\Invoke-Test.ps1' -PackagePath '<pathToIntuneWinFile>'"

User-context testing adds the following switch:

-RunAsUser

Where:

  • -executionpolicy bypass: Allows script execution without restrictions
  • -command: Executes the specified PowerShell command
  • &: PowerShell call operator to execute the script
  • Single quotes around paths handle spaces and special characters properly
  • -PackagePath: Path to the .intunewin file being tested

Development

This extension is built with TypeScript and uses the VS Code Extension API.

Building from Source

  1. Clone the repository
  2. Install dependencies: npm install
  3. Compile TypeScript: npm run compile
  4. Press F5 to run the extension in a new Extension Development Host window

Scripts

  • npm run compile: Compile TypeScript to JavaScript
  • npm run watch: Watch for changes and recompile automatically
  • npm test: Compile, lint and run the packaging tests against the real IntuneWinAppUtil.exe (C:\SandboxEnvironment\bin\IntuneWinAppUtil.exe, or set INTUNEWINAPPUTIL_PATH; skipped when the tool is missing)

Contributing

Contributions are welcome! Please feel free to submit issues or pull requests.

License

This project is licensed under the MIT License.

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
  • Your Privacy Choices
  • Consumer Health Privacy
© 2026 Microsoft