mirror of https://github.com/icsharpcode/ILSpy.git
Browse Source
* PS cmdlet to output target framework for an assembly * Add GetTargetFramework to psd1 --------- Co-authored-by: Snorri Gislason <snbeck@microsoft.com>pull/3443/head
2 changed files with 23 additions and 1 deletions
@ -0,0 +1,21 @@
@@ -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()); |
||||
} |
||||
} |
||||
} |
Loading…
Reference in new issue