Skip to content

Commit a0ca5d9

Browse files
committed
renamed init.ps1 to poke_init.ps1; added oneremove to unload init after poke unload; added psd1 metadata
1 parent 430ba2e commit a0ca5d9

File tree

4 files changed

+34
-11
lines changed

4 files changed

+34
-11
lines changed

Poke.psm1

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -929,6 +929,10 @@ Update-TypeData -typename Microsoft.PowerShell.Commands.MemberDefinition -Member
929929
# shortcut for $o | peek | gm
930930
function Get-PokeMember { $args | peek | Get-Member }
931931

932+
$ExecutionContext.SessionState.Module.OnRemove = {
933+
remove-module poke_init -ErrorAction SilentlyContinue
934+
}
935+
932936
#
933937
# Exports
934938
#

changelog.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
fixes:
66
- two tests were failing due to silly tests against private member counts to
77
validate success;
8+
- "init" script module is left loaded after a module unload - added onremove to unload it
89

910
enhancements:
1011
- now support invoking methods with out/ref parameters (poewrshell treats both as [ref])

init.ps1

Lines changed: 0 additions & 5 deletions
This file was deleted.

poke.psd1

Lines changed: 29 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Author = 'Oisin Grehan'
2424
CompanyName = 'MVP'
2525

2626
# Copyright statement for this module
27-
Copyright = '(c) 2012 Oisin Grehan. All rights reserved.'
27+
Copyright = '(c) 2012-2016 Oisin Grehan. All rights reserved.'
2828

2929
# Description of the functionality provided by this module
3030
Description = "A PowerShell module for working with non-public types and instances. Ideal for live debugging of complex .net applications, or even introspection against powershell itself. Think open brain surgery for .NET."
@@ -54,7 +54,7 @@ PowerShellVersion = '3.0'
5454
# RequiredAssemblies = @()
5555

5656
# Script files (.ps1) that are run in the caller's environment prior to importing this module
57-
ScriptsToProcess = @('init.ps1')
57+
ScriptsToProcess = @('poke_init.ps1')
5858

5959
# Type files (.ps1xml) to be loaded when importing this module
6060
# TypesToProcess = @()
@@ -66,7 +66,7 @@ FormatsToProcess = @()
6666
# NestedModules = @()
6767

6868
# Functions to export from this module
69-
FunctionsToExport = '*'
69+
FunctionsToExport = @('Get-Delegate', 'Get-PokeMember', 'Invoke-FormatHelper', 'New-InstanceProxy', 'New-ObjectProxy', 'New-TypeProxy')
7070

7171
# Cmdlets to export from this module
7272
CmdletsToExport = '*'
@@ -75,7 +75,7 @@ CmdletsToExport = '*'
7575
VariablesToExport = '*'
7676

7777
# Aliases to export from this module
78-
AliasesToExport = '*'
78+
AliasesToExport = 'peek'
7979

8080
# List of all modules packaged with this module
8181
# ModuleList = @()
@@ -84,13 +84,36 @@ AliasesToExport = '*'
8484
# FileList = @()
8585

8686
# Private data to pass to the module specified in RootModule/ModuleToProcess
87-
# PrivateData = ''
87+
PrivateData = @{
8888

89+
PSData = @{
90+
91+
# Tags applied to this module. These help with module discovery in online galleries.
92+
Tags = 'debugging','hack','peek','reflection'
93+
94+
# A URL to the license for this module.
95+
# LicenseUri = ''
96+
97+
# A URL to the main website for this project.
98+
ProjectUri = 'https://github.com/oising/poke'
99+
100+
# A URL to an icon representing this module.
101+
# IconUri = ''
102+
103+
# ReleaseNotes of this module
104+
ReleaseNotes = '1.1 - added support for out/ref parameters.'
105+
106+
# External dependent modules of this module
107+
# ExternalModuleDependencies = ''
108+
109+
} # End of PSData hashtable
110+
111+
} # End of PrivateData hashtable
112+
89113
# HelpInfo URI of this module
90114
# HelpInfoURI = ''
91115

92116
# Default prefix for commands exported from this module. Override the default prefix using Import-Module -Prefix.
93117
# DefaultCommandPrefix = ''
94118

95119
}
96-

0 commit comments

Comments
 (0)