You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This project is a **hybrid C# + PowerShell module**. The C# layer compiles into platform-specific DLLs; the PowerShell layer loads the right DLL at import time and exposes cmdlets.
Every new chart type requires changes in both layers:
78
+
79
+
1.**C# side** (`Sources/`): Add `<NewType>.cs` (chart logic) and `PowerShell/<NewType>Pwsh.cs` (the PSCmdlet class).
80
+
2.**PowerShell side**: Add the exported function name to `FunctionsToExport` in `AsBuiltReport.Chart.psd1`.
81
+
3.**Tests**: Add a `Context '<New-XChart>'` block in `Tests/AsBuiltReport.Chart.Functions.Tests.ps1`.
82
+
83
+
### Chart static-state pattern
84
+
85
+
`Chart` properties are **static**. Every `ProcessRecord()` override **must** call `Chart.Reset()` first to clear state from the previous invocation before setting new property values.
86
+
87
+
### Cross-platform path construction
88
+
89
+
Use `[System.IO.Path]::DirectorySeparatorChar` (not hardcoded `/` or `\`) when building paths in `.psm1` or C# code. The `.psm1` uses the format string pattern:
`-Values` accepts a **jagged array**: one inner `double[]` per bar/label. Wrapping a single array requires the unary comma operator to prevent flattening:
The `ValidatePath` custom attribute (defined in `PieChartPwsh.cs`) validates that the directory exists. Pass `-OutputFolderPath $TestDrive` in tests to use Pester's temp path.
106
+
107
+
### Chart cmdlet return value
108
+
109
+
All `New-*Chart` cmdlets return a `System.IO.FileSystemInfo` object (the saved file), not a string path. Tests assert `Should -BeOfType 'System.IO.FileSystemInfo'`.
110
+
111
+
### Branching
112
+
113
+
- Target PRs against the **`dev`** branch.
114
+
- Follow [Keep a Changelog](https://keepachangelog.com/) when updating `CHANGELOG.md`.
115
+
- Follow the [PowerShell Best Practices and Style Guide](https://github.com/PoshCode/PowerShellPracticeAndStyle).
116
+
- Use PascalCasing for all public member, type, and namespace names.
Copy file name to clipboardExpand all lines: AsBuiltReport.Chart/AsBuiltReport.Chart.psd1
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -12,7 +12,7 @@
12
12
RootModule='AsBuiltReport.Chart.psm1'
13
13
14
14
# Version number of this module.
15
-
ModuleVersion='0.3.1'
15
+
ModuleVersion='0.3.2'
16
16
17
17
# Supported PSEditions
18
18
# CompatiblePSEditions = @()
@@ -69,7 +69,7 @@
69
69
# NestedModules = @()
70
70
71
71
# 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.
# 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.
0 commit comments