Skip to content

Mark of the Web unblock when loading dependencies#1335

Open
rberghuis wants to merge 2 commits into
microsoft:mainfrom
rberghuis:i1330
Open

Mark of the Web unblock when loading dependencies#1335
rberghuis wants to merge 2 commits into
microsoft:mainfrom
rberghuis:i1330

Conversation

@rberghuis

@rberghuis rberghuis commented Jun 22, 2026

Copy link
Copy Markdown

0x80131515 is the result of Windows Mark of the Web (Zone.Identifier) block. During dependency loading, confirm if MotW would block load and unblock if applicable. Resolves issue #1330

Copilot AI review requested due to automatic review settings June 22, 2026 12:31
@rberghuis rberghuis changed the title Fix issue 1330 Mark of the Web unblock when loading dependencies Jun 22, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a Windows-specific mitigation for the 0x80131515 dependency load failure caused by Mark of the Web (Zone.Identifier ADS) when dependencies are downloaded and later loaded via Windows PowerShell compatibility (-UseWindowsPowerShell).

Changes:

  • Detect files under the saved dependency module folder that have an Internet/Restricted Zone.Identifier and run Unblock-File on them (Windows only).

Comment on lines +217 to +221
# Unblock files downloaded from the internet so WinPS5 implicit remoting can load their DLLs.
# Downloaded files carry a Zone.Identifier ADS mark that causes 0x80131515 when .NET tries to load them.
if ($IsWindows) {
$savedModulePath = Join-Path -Path $RequiredModulesPath -ChildPath $moduleSpec.Name
if (Test-Path -Path $savedModulePath) {
Comment thread src/powershell/Initialize-Dependencies.ps1 Outdated
Copilot provided improvement that reduces IO load by only unlocking DLL files

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 23, 2026 11:59

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.

Comment on lines +222 to +224
Get-ChildItem -Path $savedModulePath -Recurse -File -Filter '*.dll' -ErrorAction SilentlyContinue | Where-Object {
(Get-Item -LiteralPath $_.FullName -Stream Zone.Identifier -ErrorAction SilentlyContinue) -and ((Get-Content -LiteralPath $_.FullName -Stream Zone.Identifier -ErrorAction SilentlyContinue) -match 'ZoneId\s*=\s*(3|4)\b')
} | Unblock-File -ErrorAction SilentlyContinue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants