Closed sitiom closed 3 months ago
/verify
CC @chawyehsu
All changes look good.
Wait for review from human collaborators.
All changes look good.
Wait for review from human collaborators.
@chawyehsu Can you explain to me what it means to "leak" DLL imports? Perhaps the bun.sh/install.ps1
script is leaking as well?
$IsBaseline = $ForceBaseline
if (!$IsBaseline) {
$IsBaseline = !( `
Add-Type -MemberDefinition '[DllImport("kernel32.dll")] public static extern bool IsProcessorFeaturePresent(int ProcessorFeature);' `
-Name 'Kernel32' -Namespace 'Win32' -PassThru `
)::IsProcessorFeaturePresent(40);
}
"leak" DLL imports?
That means leaking imported methods to the current PS session, literally. By directly using Add-Type
to load assemblies to current session there is no way to unload it unless starting a new session. In most cases, this won't cause issues as imported methods have namespaces specified, but one may not want to have imported methods persistent in current session.
Yeah it's leaking the imported method as well. You may validate [Win32.Kernel32]::IsProcessorFeaturePresent
available after runing the install script.
I realize Scoop Core/installer having the same problem though.
Closes https://github.com/ScoopInstaller/Main/issues/5092