Skip to content

Commit fbdf5d0

Browse files
yotsudaclaude
andcommitted
Load DLL via NestedModules instead of dynamic lib/<tfm>/ lookup
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent f3ca72a commit fbdf5d0

2 files changed

Lines changed: 1 addition & 11 deletions

File tree

Staging/PowerShell.MCP.psd1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ RequiredModules = @()
6666
# FormatsToProcess = @()
6767

6868
# Modules to import as nested modules of the module specified in RootModule/ModuleToProcess
69-
NestedModules = @()
69+
NestedModules = @('PowerShell.MCP.dll')
7070

7171
# Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export.
7272
FunctionsToExport = @('Get-MCPProxyPath', 'Get-MCPOwner', 'Install-ClaudeSkill')

Staging/PowerShell.MCP.psm1

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,6 @@
11
# PowerShell.MCP Module Script
22
# Provides automatic cleanup when Remove-Module is executed
33

4-
# Load the correct binary module for the current .NET runtime
5-
Add-Type -Path (Join-Path $PSScriptRoot 'Ude.NetStandard.dll')
6-
$netMajor = [System.Environment]::Version.Major
7-
$tfm = "net$netMajor.0"
8-
$dllPath = Join-Path $PSScriptRoot 'lib' $tfm 'PowerShell.MCP.dll'
9-
if (-not (Test-Path $dllPath)) {
10-
# Fallback to net8.0 (forward compatible with .NET 9+)
11-
$dllPath = Join-Path $PSScriptRoot 'lib' 'net8.0' 'PowerShell.MCP.dll'
12-
}
13-
Import-Module $dllPath
144

155
# On Linux/macOS, PSReadLine interferes with timer events
166
# Remove it to ensure MCP polling works correctly

0 commit comments

Comments
 (0)