| external help file | Module Name | online version | schema |
|---|---|---|---|
ISpy.dll-Help.xml |
ISpy |
2.0.0 |
Decompiles .NET assemblies or specific types to readable C# source code using the decompiler engine.
Get-DecompiledSource [-Path] <String> [[-TypeName] <String>] [-OutputPath <String>]
[-Settings <DecompilerSettings>] [-Decompiler <CSharpDecompiler>] [<CommonParameters>]
Get-DecompiledSource [-TypeName] <String> [-Settings <DecompilerSettings>] [-Decompiler <CSharpDecompiler>] [<CommonParameters>]The Get-DecompiledSource cmdlet converts compiled .NET assemblies (DLLs, EXEs) into readable C# source code. You can decompile entire assemblies, focus on specific types, or extract individual methods. The output can be displayed in the console or saved directly to files for further analysis or documentation purposes.
PS C:\> Get-DecompiledSource -Path "MyLibrary.dll"This command decompiles MyLibrary.dll and writes human-readable C# source for the discovered types to the console.
PS C:\> Get-DecompiledSource -Path "MyLibrary.dll" -TypeName 'MyCompany.Core.Service' -OutputPath '.\Service.cs'This command extracts the decompiled source for the MyCompany.Core.Service type and saves it to Service.cs.
PS C:\> Get-DecompiledSource -Path "$PSHOME/Humanizer.dll"This command decompiles every type in Humanizer.dll
PS C:\> $decompiler = New-Decompiler -Path "MyLibrary.dll"
PS C:\> Get-DecompiledSource -Path "MyLibrary.dll" -TypeName 'MyCompany.Core.Service' -Decompiler $decompilerThis command uses a pre-created decompiler instance.
PS C:\> Get-DecompiledSource -TypeName System.Management.Automation.LanguagePrimitivesThis command resolves the type from loaded assemblies, discovers its assembly path automatically, and decompiles that type.
Specifies the path to the .NET assembly file to decompile.
Type: String
Required: True
Position: 0
Accept pipeline input: True (ByPropertyName, ByValue)Full name of a specific type to decompile.
Type: String
Required: False
Position: 1
Accept pipeline input: FalseWhen -Path is omitted, -TypeName is resolved against loaded AppDomain assemblies to infer the assembly path.
Custom decompiler settings used when creating a decompiler.
Type: DecompilerSettings
Required: False
Position: Named
Accept pipeline input: FalseCustom CSharpDecompiler instance to use directly.
Type: CSharpDecompiler
Required: False
Position: Named
Accept pipeline input: FalseSystem.String — accepts assembly file paths from the pipeline.
Returns an ISpyDecompilationResult containing AssemblyPath, TypeName, Source, Success, and optional FilePath.
- Use
-TypeNameto decompile a specific type, or omit to decompile the whole assembly. - Output can be piped to file or formatting cmdlets for further processing.