Skip to content

Commit 1e5a28b

Browse files
Fix invalid struct signature (#17)
- Fix an issue where the public keyword could be prepended to the StructLayout attribute causing compilation errors.
1 parent 1a0f6df commit 1e5a28b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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 )?(static|struct)', 'public $1' `
204204
-replace '\s+$' `
205205
-replace "'", "''"
206206

0 commit comments

Comments
 (0)