| external help file | Module Name | online version | schema |
|---|---|---|---|
ISpy.dll-Help.xml |
ISpy |
2.0.0 |
Exports decompiled C# source code from .NET assemblies to organized file structures with advanced bulk processing capabilities.
Export-DecompiledSource [-Path] <String> [-OutputDirectory] <String> [-TypeNames <String[]>]
[-Namespace <String>] [-CreateNamespaceDirectories] [-Settings <DecompilerSettings>] [-Decompiler <CSharpDecompiler>] [-Force]
[<CommonParameters>]The Export-DecompiledSource cmdlet provides powerful bulk decompilation capabilities for .NET assemblies. It efficiently processes large assemblies by decompiling types individually and organizing the resulting C# source code into well-structured directory hierarchies.
PS C:\> Export-DecompiledSource -Path "$PSHOME/Humanizer.dll" -OutputPath ".\Decompiled"This command decompiles Humanizer.dll and writes per-type source files into the .\Decompiled directory.
PS C:\> Export-DecompiledSource -Path "$PSHOME/Humanizer.dll" -OutputPath ".\Decompiled" -TypeNames @(
'Humanizer.NumberToWordsExtension',
'Humanizer.InflectorExtensions'
)This command decompiles only the listed fully-qualified types and writes them to the output folder.
PS C:\> Export-DecompiledSource -Path "$PSHOME/Humanizer.dll" -OutputPath ".\Decompiled" -CreateNamespaceDirectories -ForceThis command creates directories matching each type's namespace and overwrites any existing files in the target directory.
PS C:\> $decompiler = New-Decompiler -Path "$PSHOME/Humanizer.dll"
PS C:\> Export-DecompiledSource -Path "$PSHOME/Humanizer.dll" -OutputPath ".\Decompiled" -TypeNames @('Humanizer.NumberToWordsExtension') -Decompiler $decompilerThis command reuses a pre-created decompiler to export selected types.
Specifies the path to the .NET assembly file to decompile and export. This can be a DLL, EXE, or any valid .NET assembly format.
Type: String
Parameter Sets: (All)
Aliases: PSPath, Path
Required: True
Position: 0
Default value: None
Accept pipeline input: True (ByPropertyName, ByValue)
Accept wildcard characters: FalseSpecifies the root directory where decompiled source files will be exported. The directory will be created if it doesn't exist.
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies an array of specific type names to export. If not provided, all types in the assembly will be exported. Use full type names including namespace.
Type: String[]
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: All types in assembly
Accept pipeline input: False
Accept wildcard characters: FalseCustom DecompilerSettings 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: FalseReturns an ISpyExportResult object containing information about exported files.
- Use
-TypeNamesto export only specific types. - Use
-CreateNamespaceDirectoriesto mirror namespaces in the output folder structure. - Use
-Forceto overwrite existing files.