Browse Source

Update ICSharpCode.Decompiler.PowerShell to 4.0.0.4201-alpha1

pull/1420/head
Siegfried Pammer 7 years ago
parent
commit
e134396912
  1. 5
      ICSharpCode.Decompiler.PowerShell/GetDecompiledProjectCmdlet.cs
  2. 2
      ICSharpCode.Decompiler.PowerShell/GetDecompiledTypesCmdlet.cs
  3. 4
      ICSharpCode.Decompiler.PowerShell/ICSharpCode.Decompiler.PowerShell.csproj
  4. 12
      ICSharpCode.Decompiler.PowerShell/README.md

5
ICSharpCode.Decompiler.PowerShell/GetDecompiledProjectCmdlet.cs

@ -4,7 +4,6 @@ using System.IO; @@ -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 @@ -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) {

2
ICSharpCode.Decompiler.PowerShell/GetDecompiledTypesCmdlet.cs

@ -25,7 +25,7 @@ namespace ICSharpCode.Decompiler.PowerShell @@ -25,7 +25,7 @@ namespace ICSharpCode.Decompiler.PowerShell
try {
List<ITypeDefinition> output = new List<ITypeDefinition>();
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);

4
ICSharpCode.Decompiler.PowerShell/ICSharpCode.Decompiler.PowerShell.csproj

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
@ -8,7 +8,7 @@ @@ -8,7 +8,7 @@
<ItemGroup>
<PackageReference Include="PowerShellStandard.Library" Version="5.1.0-preview-03" />
<PackageReference Include="ICSharpCode.Decompiler" Version="3.1.0.3652" />
<PackageReference Include="ICSharpCode.Decompiler" Version="4.0.0.4201-alpha1" />
</ItemGroup>
</Project>

12
ICSharpCode.Decompiler.PowerShell/README.md

@ -15,9 +15,9 @@ Tested with: PowerShell 5.1 on Windows, PowerShell Core on Windows and Mac (Beta @@ -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
* 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
Loading…
Cancel
Save