Skip to content

Commit 89daa13

Browse files
feat: Vector scaffolding ( Fixes #1 )
1 parent 1138373 commit 89daa13

File tree

2 files changed

+4
-40
lines changed

2 files changed

+4
-40
lines changed

Vector.psd1

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

1414
# Version number of this module.
15-
ModuleVersion = '0.0.1'
15+
ModuleVersion = '0.1'
1616

1717
# Supported PSEditions
1818
# CompatiblePSEditions = @()
@@ -21,7 +21,7 @@ ModuleVersion = '0.0.1'
2121
GUID = '2110de70-cbfb-4e01-b273-e7db122a4a53'
2222

2323
# Author of this module
24-
Author = 'PowerPi'
24+
Author = 'James Brundage'
2525

2626
# Company or vendor of this module
2727
CompanyName = 'Start-Automating'
@@ -69,7 +69,7 @@ Description = 'Vectors in PowerShell'
6969
# NestedModules = @()
7070

7171
# Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export.
72-
FunctionsToExport = 'Get-Vector2', 'Get-Vector3', 'Get-Vector4'
72+
FunctionsToExport = 'Get-Vector', 'Get-Vector2', 'Get-Vector3', 'Get-Vector4'
7373

7474
# Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export.
7575
CmdletsToExport = '*'
@@ -78,7 +78,7 @@ CmdletsToExport = '*'
7878
VariablesToExport = '*'
7979

8080
# Aliases to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no aliases to export.
81-
AliasesToExport = 'V2', 'V3', 'V4', 'Vector2', 'Vector3', 'Vector4'
81+
AliasesToExport = 'V1', 'V2', 'V3', 'V4', 'Vector1', 'Vector2', 'Vector3', 'Vector4', 'Vector'
8282

8383
# DSC resources to export from this module
8484
# DscResourcesToExport = @()

Vector.psm1

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -29,40 +29,6 @@ if ($home) {
2929
$script:this = $myModule
3030

3131
#region Custom
32-
33-
foreach ($type in [Numerics.Vector2], [Numerics.Vector3],[Numerics.Vector4]) {
34-
$staticMembers = $type | Get-Member -Static
35-
$typeData = [Management.Automation.Runspaces.TypeData]::new($type.FullName)
36-
foreach ($staticMember in $staticMembers) {
37-
if ($staticMember.MemberType -eq 'Method' -and
38-
$staticMember.Definition -match "\($([Regex]::Escape($type.FullName))\s\w+\)"
39-
) {
40-
$typeData.Members.Add(
41-
$staticMember.Name,
42-
[Management.Automation.Runspaces.ScriptMethodData]::new(
43-
$staticMember.Name,
44-
[ScriptBlock]::Create("
45-
`$invokeArgs = @(`$this) + `$args
46-
[$($type.FullName -replace '^System\.')]::$($staticMember.Name).Invoke(`$invokeArgs)
47-
")
48-
)
49-
)
50-
}
51-
if ($staticMember.MemberType -eq 'Property' -and
52-
$staticMember.Definition -match "^$([Regex]::Escape($type.FullName))\s") {
53-
<#$typeData.Members.Add(
54-
$staticMember.Name,
55-
[Management.Automation.Runspaces.ScriptPropertyData]::new(
56-
$staticMember.Name,
57-
[ScriptBlock]::Create("[$($type.FullName -replace '^System\.')]::$($staticMember.Name)")
58-
)
59-
)#>
60-
}
61-
62-
}
63-
Update-TypeData -TypeData $typeData -Force
64-
}
65-
6632
$MyInvocation.MyCommand.ScriptBlock.Module.OnRemove = {
6733
Remove-TypeData -ErrorAction Ignore -TypeName 'System.Numerics.Vector2'
6834
Remove-TypeData -ErrorAction Ignore -TypeName 'System.Numerics.Vector3'
@@ -71,5 +37,3 @@ $MyInvocation.MyCommand.ScriptBlock.Module.OnRemove = {
7137
#endregion Custom
7238

7339
Export-ModuleMember -Alias * -Function * -Variable $myModule.Name
74-
75-

0 commit comments

Comments
 (0)