mirror of
https://github.com/icsharpcode/ILSpy.git
synced 2026-10-12 02:15:58 +00:00
PSCmdLet to output target framework for an assembly (#3435)
* PS cmdlet to output target framework for an assembly * Add GetTargetFramework to psd1 --------- Co-authored-by: Snorri Gislason <[email protected]>
This commit is contained in:
co-authored by
Snorri Gislason
parent
247f161eb3
commit
d2d76eceaa
@@ -0,0 +1,21 @@
|
||||
using System.Management.Automation;
|
||||
|
||||
using ICSharpCode.Decompiler.CSharp;
|
||||
using ICSharpCode.Decompiler.Metadata;
|
||||
|
||||
namespace ICSharpCode.Decompiler.PowerShell
|
||||
{
|
||||
[Cmdlet(VerbsCommon.Get, "TargetFramework")]
|
||||
[OutputType(typeof(string))]
|
||||
public class GetTargetFramework : PSCmdlet
|
||||
{
|
||||
[Parameter(Position = 0, Mandatory = true)]
|
||||
public CSharpDecompiler Decompiler { get; set; }
|
||||
|
||||
protected override void ProcessRecord()
|
||||
{
|
||||
MetadataFile module = Decompiler.TypeSystem.MainModule.MetadataFile;
|
||||
WriteObject(module.Metadata.DetectTargetFrameworkId());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -68,7 +68,8 @@
|
||||
'Get-DecompiledSource',
|
||||
'Get-DecompiledTypes',
|
||||
'Get-Decompiler',
|
||||
'Get-DecompilerVersion'
|
||||
'Get-DecompilerVersion',
|
||||
'Get-TargetFramework'
|
||||
)
|
||||
|
||||
# Variables to export from this module
|
||||
|
||||
Reference in New Issue
Block a user