From e134396912a2e924ce9605acb98e8b3d4e1c371b Mon Sep 17 00:00:00 2001 From: Siegfried Pammer Date: Wed, 18 Jul 2018 21:31:56 +0200 Subject: [PATCH] Update ICSharpCode.Decompiler.PowerShell to 4.0.0.4201-alpha1 --- .../GetDecompiledProjectCmdlet.cs | 5 +---- .../GetDecompiledTypesCmdlet.cs | 2 +- .../ICSharpCode.Decompiler.PowerShell.csproj | 4 ++-- ICSharpCode.Decompiler.PowerShell/README.md | 12 ++++++------ 4 files changed, 10 insertions(+), 13 deletions(-) diff --git a/ICSharpCode.Decompiler.PowerShell/GetDecompiledProjectCmdlet.cs b/ICSharpCode.Decompiler.PowerShell/GetDecompiledProjectCmdlet.cs index bbce59a7e..f5fa4579e 100644 --- a/ICSharpCode.Decompiler.PowerShell/GetDecompiledProjectCmdlet.cs +++ b/ICSharpCode.Decompiler.PowerShell/GetDecompiledProjectCmdlet.cs @@ -4,7 +4,6 @@ using System.IO; using System.Management.Automation; using System.Text; using ICSharpCode.Decompiler.CSharp; -using Mono.Cecil; namespace ICSharpCode.Decompiler.PowerShell { @@ -31,10 +30,8 @@ namespace ICSharpCode.Decompiler.PowerShell try { - string assemblyFileName = Decompiler.TypeSystem.Compilation.MainAssembly.UnresolvedAssembly.Location; // just to keep the API "the same" across all cmdlets - ModuleDefinition module = UniversalAssemblyResolver.LoadMainModule(assemblyFileName); WholeProjectDecompiler decompiler = new WholeProjectDecompiler(); - decompiler.DecompileProject(module, path); + decompiler.DecompileProject(Decompiler.TypeSystem.MainModule.PEFile, path); WriteObject("Decompilation finished"); } catch (Exception e) { diff --git a/ICSharpCode.Decompiler.PowerShell/GetDecompiledTypesCmdlet.cs b/ICSharpCode.Decompiler.PowerShell/GetDecompiledTypesCmdlet.cs index 7893527b6..19d910533 100644 --- a/ICSharpCode.Decompiler.PowerShell/GetDecompiledTypesCmdlet.cs +++ b/ICSharpCode.Decompiler.PowerShell/GetDecompiledTypesCmdlet.cs @@ -25,7 +25,7 @@ namespace ICSharpCode.Decompiler.PowerShell try { List output = new List(); - foreach (var type in Decompiler.TypeSystem.Compilation.MainAssembly.GetAllTypeDefinitions()) { + foreach (var type in Decompiler.TypeSystem.MainModule.TypeDefinitions) { if (!kinds.Contains(type.Kind)) continue; output.Add(type); diff --git a/ICSharpCode.Decompiler.PowerShell/ICSharpCode.Decompiler.PowerShell.csproj b/ICSharpCode.Decompiler.PowerShell/ICSharpCode.Decompiler.PowerShell.csproj index 7c1944786..cd884be6f 100644 --- a/ICSharpCode.Decompiler.PowerShell/ICSharpCode.Decompiler.PowerShell.csproj +++ b/ICSharpCode.Decompiler.PowerShell/ICSharpCode.Decompiler.PowerShell.csproj @@ -1,4 +1,4 @@ - + netstandard2.0 @@ -8,7 +8,7 @@ - + diff --git a/ICSharpCode.Decompiler.PowerShell/README.md b/ICSharpCode.Decompiler.PowerShell/README.md index 6bc201169..2bac472f4 100644 --- a/ICSharpCode.Decompiler.PowerShell/README.md +++ b/ICSharpCode.Decompiler.PowerShell/README.md @@ -15,9 +15,9 @@ Tested with: PowerShell 5.1 on Windows, PowerShell Core on Windows and Mac (Beta ## Links for developing PS cmdlets -https://docs.microsoft.com/en-us/powershell/gallery/psgallery/creating-and-publishing-an-item -https://github.com/mmaitre314/PowerShellGet-Test-Binary-Module -https://www.red-gate.com/simple-talk/dotnet/net-development/using-c-to-create-powershell-cmdlets-beyond-the-basics/ -https://msdn.microsoft.com/en-us/library/dd878294(v=VS.85).aspx Writing a Windows PowerShell Cmdlet -https://msdn.microsoft.com/en-us/library/ms714428(v=vs.85).aspx Approved verbs -https://www.google.com/search?q=write+a+module+for+powershell+core \ No newline at end of file +* https://docs.microsoft.com/en-us/powershell/gallery/psgallery/creating-and-publishing-an-item +* https://github.com/mmaitre314/PowerShellGet-Test-Binary-Module +* https://www.red-gate.com/simple-talk/dotnet/net-development/using-c-to-create-powershell-cmdlets-beyond-the-basics/ +* https://msdn.microsoft.com/en-us/library/dd878294(v=VS.85).aspx Writing a Windows PowerShell Cmdlet +* https://msdn.microsoft.com/en-us/library/ms714428(v=vs.85).aspx Approved verbs +* https://www.google.com/search?q=write+a+module+for+powershell+core \ No newline at end of file