Forum Discussion
qotd00
Jun 08, 2023Copper Contributor
How to define a dynamic module in powershell 7
.Net Core Hello, I'm currently trying to migrate a powershell 5 script to a powershell 7 one. The goal of this script is to load the win32 api in memory using [AppDomain]::CurrentDomain and assemb...
LainRobertson
Jun 08, 2023Silver Contributor
This is expected since - to paraphrase the following article - Windows PowerShell leverages the full .NET Framework while PowerShell leverages .NET Core, which is a subset of the .NET Framework:
In your specific case, if you compare the class reference for System.AppDomain for the .NET Framework against the .NET Core platforms, you can clearly see (or not see, as is the case) that the .NET Core version of System.AppDomain indeed does not contain the method DefineDynamicAssembly:
- .NET Framework: AppDomain Class (System) | Microsoft Learn
- .NET Core: AppDomain Class (System) | Microsoft Learn
Cheers,
Lain