Category filter
Fix EXE Installer Script Failed Errors on Windows
TL;DR
Windows custom scripts that download and run large .exe installers through Hexnode UEM can fail with Start-Process : This command cannot be run due to the error: The file or directory is corrupted and unreadable. This usually occurs when the script downloads an HTML sign-in page, confirmation page, or partial file instead of the installer. Cloud storage links that require Microsoft credentials or display an additional download confirmation prompt are common causes.
Host the installer at a publicly accessible direct-download URL that does not require authentication, redirects to a sign-in page, or require user confirmation. A public Google Cloud Storage Bucket URL was confirmed to work for a large Windows installer deployment after authenticated cloud storage links failed.
Executive Summary
- Affected scope: Windows devices running PowerShell-based custom scripts deployed through Hexnode.
- Common symptom:
Start-Processreports that the downloaded file or directory is corrupted and unreadable. - Primary cause: The download URL does not return the actual installer file without user interaction.
- Confirmed resolution: Replace the cloud storage link with a publicly accessible direct-download URL, such as a public Google Cloud Storage Bucket URL.
- Validation step: Run the same PowerShell script manually on a test Windows device before deploying it through Hexnode UEM.
Error message shown during script execution
The script may show output similar to the following after the installer download and installation command begins:
|
1 2 3 4 5 6 7 8 9 10 11 |
Start-Process : This command cannot be run due to the error: The file or directory is corrupted and unreadable. At C:\Hexnode\Hexnode Agent\Current\resource\...:20 char:5 + Start-Process -FilePath $filepath -ArgumentList $argumentList -Wa ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (:) [Start-Process], InvalidOperationException + FullyQualifiedErrorId : InvalidOperationException,StartProcessCommand |
The path under C:\Hexnode\Hexnode Agent\Current\resource\... refers to the location where the Hexnode Agent downloads the script resource before executing it. It does not necessarily mean that Hexnode UEM is trying to run the installer from that path.
The Output can be verified from the Action History sub-tab of the device and clicking on the corresponding the Execute Custom Script action.
Learn more about executing custom scripts on Windows devices.
Why the downloaded installer becomes unreadable
The Start-Process error can appear even when the script syntax and installer arguments are correct. In the confirmed case, the issue was caused by the file URL rather than the PowerShell command.
When a script downloads an installer from a cloud storage link, the URL must return the installer binary directly. The deployment can fail if the URL returns any of the following instead:
- A Microsoft sign-in page or any authentication prompt.
- A cloud storage preview page instead of the file.
- A browser-based confirmation prompt for large files.
- An incomplete or redirected download response.
Note: Some cloud storage services generate additional confirmation prompts for files larger than 100 MB. If the installer is over 100 MB, verify that the URL downloads the file directly without any browser prompt or credentials.
Resolve the Start-Process corrupted file error
- Host the
.exeinstaller in a location that supports public direct downloads. - Confirm that the URL does not require credentials, browser interaction, or a confirmation prompt.
- Open the URL in a private or signed-out browser session to verify that the installer downloads immediately.
- Update the PowerShell script to use the verified direct-download URL.
- Confirm that the downloaded file path in the script points to the actual installer filename, such as
falconsensor.exeor the installer filename used in your deployment. - Run the script manually on a test Windows device through PowerShell to validate the download and installation behavior.
- After the script succeeds manually, deploy the same script remotely through Hexnode UEM.
Workaround: Replacing the failing cloud storage link with a public Google Cloud Storage Bucket URL allows the PowerShell script to install the Windows application successfully.
Validate the script manually before deploying through Hexnode UEM
Manual validation helps separate script issues from remote deployment issues. On a test Windows device, run the PowerShell script locally and confirm that it downloads and starts the installer without requiring any interactive sign-in or browser prompt.
If PowerShell blocks local script execution, the device may show an error similar to:
|
1 2 3 4 5 6 7 |
File ... cannot be loaded because running scripts is disabled on this system. For more information, see about_Execution_Policies + CategoryInfo : SecurityError: (:) [], ParentContainsErrorRecordException + FullyQualifiedErrorId : UnauthorizedAccess |
To view the execution policy configuration, run:
|
1 |
Get-ExecutionPolicy -List |
To allow the current user to run scripts for manual testing, run:
|
1 |
Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Scope CurrentUser |
Note: Changing the PowerShell execution policy on a test device is only a validation step. It does not resolve a failed download URL that returns a sign-in page, confirmation page, or incomplete installer.
Troubleshooting checklist for Windows installer script deployments
The URL opens a sign-in page
Use a different hosting location that provides a public direct-download URL. Links that require Microsoft credentials or any other authentication cannot be used as unattended installer downloads.
The installer is larger than 100 MB
Verify that the hosting service does not show an additional large-file confirmation prompt. If it does, move the installer to a storage service that supports direct public object downloads, such as a public Google Cloud Storage Bucket URL.
The script works manually only after changing the execution policy
The local device is blocking PowerShell script execution. Use Get-ExecutionPolicy -List to inspect the policy and adjust it only as needed for validation. If the script still reports that the file is corrupted after the policy change, re-check the installer URL.
The script output references C:\Hexnode\Hexnode Agent\Current\resource
This path refers to where the Hexnode UEM Agent stores the script resource before execution. It is expected during Hexnode script deployment and is not, by itself, the cause of the installer failure.
Review script execution activity in Hexnode
Script-related device actions can be reviewed from:
Reports -> Action reports -> Action history.
Sort the action by “Execute Custom Script” and filter the devices.
Note: Custom reports for selecting script execution attributes or filtering custom script results by success and failure can be created from Hexnode UEM.
- Navigate to Reports -> Custom reports -> Add -> Action.
- Provide Report name and Description.
- Set Condition Filters where Action name is “Execute Custom Script”.
- Add the available columns including Action status.
- This report will segregate all the Execute Custom Script action executed across various Windows devices.
Frequently Asked Questions
Can Hexnode UEM run a PowerShell script that downloads an installer from OneDrive?
Only if the OneDrive URL downloads the installer directly without authentication or user interaction. If the link requires Microsoft credentials or opens a browser page before download, the unattended script may download the wrong content and fail with a Start-Process corrupted or unreadable file error.
Why does the script deployment output that the file is corrupted if the installer link works in a browser?
A browser session may already be authenticated or may allow the user to click through a confirmation prompt. A Hexnode-deployed script runs unattended and requires the URL to return the installer file directly. If the URL returns a sign-in page, preview page, or confirmation page, Start-Process cannot run it as an executable.
What type of file download URL works for the large installer deployment?
A public Google Cloud Storage Bucket URL works for a large Windows installer if other cloud storage links fails. The important requirement is that the URL must be publicly accessible and must download the installer file directly.
Where can script execution activity be checked?
Use Reports -> Action reports -> Action history to review available device action records related to script execution.