Skip to content

Commit 6aae020

Browse files
Update README and manifest for 0.3.0 (#18)
- Update commands table in README with Add-PinvokeMethod - Update manifest version and release notes - Update documentation module page with Add-PinvokeMethod - Fix an issue in Add-PinvokeMethod where it wouldn't replace internal modifiers with public.
1 parent 1e5a28b commit 6aae020

File tree

4 files changed

+10
-9
lines changed

4 files changed

+10
-9
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@ All commands unless otherwise noted target the closest relevant expression.
8080
|Function Name|Editor Command Name|Description|
8181
|---|---|---|
8282
|Add-CommandToManifest|Add Closest Function To Manifest|Add a function to the manifest fields ExportedFunctions and FileList|
83+
|Add-ModuleQualifcation|Add Module Name to Closest Command|Infers the origin module of the command closest to the cursor and prepends the module name|
84+
|Add-PinvokeMethod|Insert Pinvoke Method Definition|Searches the pinvoke.net web service for a matching function and creates a Add-Type expression with the signature|
8385
|ConvertTo-LocalizationString|Add Closest String to Localization File|Replaces a string expression with a variable that references a localization file, and adds the string to that file|
8486
|ConvertTo-MarkdownHelp|Generate Markdown from Closest Function|Generate markdown using PlatyPS, add the markdown file to your docs folder, and replace the comment help with an external help file comment.|
8587
|ConvertTo-SplatExpression|Convert Command to Splat Expression|Create a splat hashtable variable from named parameters in a command and replace the named parameters with a a splat expression.|

docs/en-US/EditorServicesCommandSuite.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ The Add-CommandToManifest function finds the closest function definition in the
2222

2323
The Add-ModuleQualification function retrieves the module a command belongs to and prepends the module name to the expression.
2424

25+
### [Add-PinvokeMethod](Add-PinvokeMethod.md)
26+
27+
The Add-PinvokeMethod function searches pinvoke.net for the requested function name and provides a list of matches to select from. Once selected, this function will get the signature and create a expression that uses the Add-Type cmdlet to create a type with the PInvoke method.
28+
2529
### [ConvertTo-LocalizationString](ConvertTo-LocalizationString.md)
2630

2731
The ConvertTo-LocalizationString function will take the closest string expression and replace it with a variable that references a localization resource file.

module/EditorServicesCommandSuite.psd1

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
RootModule = 'EditorServicesCommandSuite.psm1'
1313

1414
# Version number of this module.
15-
ModuleVersion = '0.2.1'
15+
ModuleVersion = '0.3.0'
1616

1717
# ID used to uniquely identify this module
1818
GUID = '97607afd-d9bd-4a2e-a9f9-70fe1a0a9e4c'
@@ -106,13 +106,8 @@ PrivateData = @{
106106

107107
# ReleaseNotes of this module
108108
ReleaseNotes = @'
109-
- ConvertTo-SplatExpression will now handle positional arguments as well if the command exists in the session
110-
111-
- Add-ModuleQualification will now work in all workspace configurations
112-
113-
- ConvertTo-MarkdownHelp will now generate the correct online help URI and will create the markdown
114-
docs folder if it does not already exist. It will now also correctly handle situations where
115-
multiple versions of the same module are imported.
109+
- New editor command Add-PinvokeMethod. Allows you to search the pinvoke.net web service for
110+
matching functions and inserts a Add-Type statement to the current file.
116111
'@
117112

118113
} # End of PSData hashtable

module/Public/Add-PinvokeMethod.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ function Add-PinvokeMethod {
200200
$signature = $signatureInfo.Signature `
201201
-split '\|' `
202202
-join [Environment]::NewLine `
203-
-replace '(?<!public )(?<!\[)(?:private )?(static|struct)', 'public $1' `
203+
-replace '(?<!public )(?<!\[)(?:private |internal )?(static|struct)', 'public $1' `
204204
-replace '\s+$' `
205205
-replace "'", "''"
206206

0 commit comments

Comments
 (0)