-
Notifications
You must be signed in to change notification settings - Fork 5
Configuring Windows Run
Run local executables and/or download and run executables. Execute programs, scripts, or installers as part of the configuration process.
The windowsRun module executes local or remote executables with optional arguments. It handles running executables from local file paths or downloading and executing files from remote URLs. This is useful for running installers, configuration tools, or custom scripts as part of the deployment process.
The module supports two execution modes:
- Local execution - runs existing executables from specified file paths on the device.
- Remote execution - downloads an executable from a URL, then runs it.
For each configured executable, the module performs the following steps:
- Validates OS build requirements (
minOSbuildandmaxOSbuild) - Expands Windows environment variables in file paths (e.g.,
%TEMP%,%ProgramFiles%) - Downloads the file if
downloadUriis specified (viaInvoke-WebRequest) - Verifies the file exists at the specified path
- Retrieves file version and description information for logging
- Executes the file with or without arguments using
Start-Process - Waits for process completion before continuing
All executions use -NoNewWindow -Wait flags to run processes in the same window and wait for completion before proceeding.
The following shows the windowsRun configuration structure with two example items - one for updating a local executable and one for downloading and running an installer.
{
"windowsRun": {
"enabled": true,
"items": [
{
"name": "Microsoft Edge",
"description": "Update Microsoft Edge",
"informationURL": "https://learn.microsoft.com/deployedge/deploy-edge-with-windows-10-updates/",
"minOSbuild": "",
"maxOSbuild": "",
"downloadUri": "",
"filePath": "%ProgramFiles(x86)%\\Microsoft\\EdgeUpdate\\MicrosoftEdgeUpdate.exe",
"ArgumentList": "/install appguid={56EB18F8-B008-4CBD-B6D2-8C97FE7E9062}&appname=Microsoft%20Edge&needsadmin=True /silent"
},
{
"name": "Microsoft OneDrive",
"description": "Download and install OneDriveSetup.exe for all users",
"informationURL": "",
"minOSbuild": "",
"maxOSbuild": "22621",
"downloadUri": "https://go.microsoft.com/fwlink/p/?LinkID=2182910",
"filePath": "%TEMP%\\OneDriveSetup.exe",
"ArgumentList": "/allusers /silent"
}
]
}
}The following properties are supported in the windowsRun section.
| Property | Description | Type | Required |
|---|---|---|---|
| windowsRun | |||
| enabled | Enable or disable the module | Boolean | No |
| items (array) | |||
| name | Operation name - used for logging and readability | String | Yes |
| description | Description of the executable operation - used for documentation purposes | String | No |
| informationURL | URL for more information about the executable or operation | String | No |
| minOSbuild | Minimum Windows build number required for this operation. Empty string means no restriction | String | No |
| maxOSbuild | Maximum Windows build number allowed for this operation. Empty string means no restriction | String | No |
| downloadUri | URL to download the executable before running. Empty string for local executables | String | No |
| filePath | Path to the executable on the device. Supports Windows environment variables (e.g., %TEMP%, %ProgramFiles%) |
String | Yes |
| ArgumentList | Command-line arguments to pass to the executable | String | No |
The commands below can be used to verify executables and inspect file properties.
Check whether an executable exists at the expected path.
Test-Path -Path "${env:ProgramFiles(x86)}\Microsoft\EdgeUpdate\MicrosoftEdgeUpdate.exe"Retrieve the version and description of an executable.
(Get-Item -Path "${env:ProgramFiles(x86)}\Microsoft\EdgeUpdate\MicrosoftEdgeUpdate.exe").VersionInfo | Select-Object "FileVersion", "FileDescription", "ProductVersion"For more information, see the following resources.
- Start-Process - PowerShell reference for starting processes
- Invoke-WebRequest - PowerShell reference for downloading files
Page revised: March 4, 2026
🦎 Windows gecko - Desired state configuration for Windows devices · Repository · License
Windows gecko wiki
Getting Started
Feature Modules
- Configuring Windows Apps
- Configuring Windows branding
- Configuring Windows Config
- Configuring Windows Features
- Configuring Windows Files
- Configuring Windows Groups
- Configuring Windows Registry
- Configuring Windows Run
- Configuring Windows Scheduled Tasks
- Configuring Windows Services
- Configuring Windows TCR
Contributing