GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Fix the TPA in a more reliable way by daxian-dbw · Pull Request #115 · PowerShell/PowerShell-Native

Conversation

@daxian-dbw

@daxian-dbw Dongbo Wang (daxian-dbw) commented Sep 14, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

PR Summary

Fix #114
Also fix the following PowerShell issues:

  • #requires -Modules fails in Enter-PSSession remoting session (PowerShell.7 endpoint) — regression from 7.4 to 7.6 PowerShell#27907
  • Remote session (wsmprovhost.exe) cannot resolve assemblies due to PowerShellAssemblyLoadContext being initialized with empty basePaths PowerShell#27982
  • ActiveDirectory module does not work over remoting in PS 7.6 PowerShell#27199

Replace the hard-coded Trusted Platform Assemblies (TPA) allow-list used by pwrshplugin.dll with a deny-list constructed from the DLLs installed alongside .NET runtime.

Motivation

The set of trusted platform assemblies differs across supported PowerShell versions, including 7.4, 7.5, and 7.6. Maintaining an explicit allow-list causes the WinRM hosting code to fall out of sync as assemblies are added, removed, or renamed.

Comparing TRUSTED_PLATFORM_ASSEMBLIES from pwsh.exe with the DLLs under $PSHOME showed that the TPA list is consistently the set of installed DLLs minus a relatively stable group of native and host binaries.

Changes

  • Enumerate *.dll files immediately under coreCLRDirectoryPath.
  • Include each discovered DLL in the TPA list unless it is a known native or host binary.
  • Match deny-list entries case-insensitively.
  • Exclude files beginning with mscordaccore_ to account for architecture- and version-specific filenames.
  • Exclude Microsoft.PowerShell.GraphicalHost.dll, which is not usable in a remoting session.
  • Include other PowerShell managed assemblies in the TPA list.
  • Remove the obsolete .ni.dll probing logic because modern PowerShell distributions no longer include native-image assemblies.
  • Remove outdated comments.
  • Add FindFirstFileA, FindNextFileA, and FindClose to the existing system-call facade so directory enumeration follows the current dependency-injection design.

This makes TPA construction resilient to assembly changes across PowerShell and .NET servicing releases while retaining a small, stable deny-list.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

0xfeeddeadbeef reacted with hooray emoji
All reactions
  • 🎉 1 reaction
@daxian-dbw
Fix the TPA in a more reliable way
59a3007
@azure-pipelines

azure-pipelines Bot commented Sep 14, 2026

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@daxian-dbw

Dongbo Wang (daxian-dbw) commented Sep 14, 2026

Copy link
Copy Markdown
Member Author

/azp run

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@azure-pipelines

azure-pipelines Bot commented Sep 14, 2026

Copy link
Copy Markdown
Commenter does not have sufficient privileges for PR 115 in repo PowerShell/PowerShell-Native
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@adityapatwardhan

Aditya Patwardhan (adityapatwardhan) commented Sep 14, 2026

Copy link
Copy Markdown
Member

/azp run

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@azure-pipelines

azure-pipelines Bot commented Sep 14, 2026

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

This was referenced Sep 16, 2026
Remote session (wsmprovhost.exe) cannot resolve assemblies due to PowerShellAssemblyLoadContext being initialized with empty basePaths PowerShell/PowerShell#27982
Closed
Add NetFramingBase to TPA for AD module compat #113
Closed
@daxian-dbw
Don't add 'pwsh.dll' to TPA list
5b080c2
@daxian-dbw

Dongbo Wang (daxian-dbw) commented Sep 16, 2026

Copy link
Copy Markdown
Member Author

/azp run

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@azure-pipelines

azure-pipelines Bot commented Sep 16, 2026

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Tadas Tadas Medišauskas (Tadas) mentioned this pull request Sep 17, 2026
ActiveDirectory module does not work over remoting in PS 7.6 PowerShell/PowerShell#27199
Closed
5 tasks done
adityapatwardhan
Aditya Patwardhan (adityapatwardhan) requested changes Sep 17, 2026
View reviewed changes
Comment thread src/powershell-native/nativemsh/pwrshcommon/pwrshcommon.cpp Resolved

Uh oh!

There was an error while loading. Please reload this page.

adityapatwardhan
Aditya Patwardhan (adityapatwardhan) reviewed Sep 17, 2026
View reviewed changes
Comment thread src/powershell-native/nativemsh/pwrshcommon/pwrshcommon.cpp
"clrjit.dll",
"coreclr.dll",
"D3DCompiler_47_cor3.dll",
"getfilesiginforedist.dll",

@adityapatwardhan Aditya Patwardhan (adityapatwardhan) Sep 17, 2026

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Also this "getfilesiginforedistwrapper.dll" ?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@daxian-dbw Dongbo Wang (daxian-dbw) Sep 17, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

getfilesiginforedistwrapper.dll is included in the TPA list of pwsh.exe, so it's not excluded here. You can find it by running [AppContext]::GetData('TRUSTED_PLATFORM_ASSEMBLIES') from pwsh.

I compared the new TPAs in the plugin and those in pwsh.exe (7.4.20, 7.5.11, and 7.6.6), only 2 are intentionally excluded from the plugin:

  • Microsoft.PowerShell.GraphicalHost.dll
  • pwsh.dll

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
adityapatwardhan
Aditya Patwardhan (adityapatwardhan) approved these changes Sep 17, 2026
View reviewed changes
@adityapatwardhan

Aditya Patwardhan (adityapatwardhan) commented Sep 17, 2026

Copy link
Copy Markdown
Member

/azp run

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@azure-pipelines

azure-pipelines Bot commented Sep 17, 2026

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 2 pipeline(s).
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@adityapatwardhan Aditya Patwardhan (adityapatwardhan) closed this Sep 17, 2026
@adityapatwardhan Aditya Patwardhan (adityapatwardhan) reopened this Sep 17, 2026
@adityapatwardhan

Aditya Patwardhan (adityapatwardhan) commented Sep 17, 2026

Copy link
Copy Markdown
Member

/azp run

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@azure-pipelines

azure-pipelines Bot commented Sep 17, 2026

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 2 pipeline(s).
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@adityapatwardhan
Aditya Patwardhan (adityapatwardhan) merged commit 0e619ce into PowerShell:master Sep 17, 2026
12 of 13 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@daxian-dbw
Dongbo Wang (daxian-dbw) deleted the tpa branch September 17, 2026 23:39
This was referenced Sep 17, 2026
#requires -Modules fails in Enter-PSSession remoting session (PowerShell.7 endpoint) — regression from 7.4 to 7.6 PowerShell/PowerShell#27907
Closed
Need to release a new version of Microsoft.PowerShell.Native nuget package #116
Open
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@adityapatwardhan Aditya Patwardhan (adityapatwardhan) adityapatwardhan approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

System.IO.Pipelines missing from the TRUSTED_PLATFORM_ASSEMBLIES array

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@daxian-dbw @adityapatwardhan
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.