-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Closed
Labels
Resolution-FixedThe issue is fixed.The issue is fixed.WG-Cmdlets-Utilitycmdlets in the Microsoft.PowerShell.Utility modulecmdlets in the Microsoft.PowerShell.Utility module
Description
On Windows PowerShell, Add-Type returns the same assembly when running it multiple times with the same source code.
While on PowerShell Core, Add-Type returns different assemblies when running it multiple times with the same source code.
Steps to reproduce
> $code = @'
public class Foo {
public string Name = "name";
}
'@
> (Add-Type $code -PassThru).Assembly.FullNameExpected behavior
Like on Windows PowerShell, the same assembly is returned when using the same source code.
> (Add-Type $code -PassThru).Assembly.FullName
4woxc1pb, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
> (Add-Type $code -PassThru).Assembly.FullName
4woxc1pb, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
> (Add-Type $code -PassThru).Assembly.FullName
4woxc1pb, Version=0.0.0.0, Culture=neutral, PublicKeyToken=nullActual behavior
> (Add-Type $code -PassThru).Assembly.FullName
z4vydr0b.yke, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
> (Add-Type $code -PassThru).Assembly.FullName
gyos43ig.yjb, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
> (Add-Type $code -PassThru).Assembly.FullName
wsxcciz3.544, Version=0.0.0.0, Culture=neutral, PublicKeyToken=nullEnvironment data
> $PSVersionTable
Name Value
---- -----
PSVersion 6.0.0-rc
PSEdition Core
GitCommitId v6.0.0-rc-3-g5702081ae6d116455f6cff30e7b509abf21ae609
OS Microsoft Windows 10.0.15063
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0Metadata
Metadata
Assignees
Labels
Resolution-FixedThe issue is fixed.The issue is fixed.WG-Cmdlets-Utilitycmdlets in the Microsoft.PowerShell.Utility modulecmdlets in the Microsoft.PowerShell.Utility module