Skip to content

Commit 2356dbd

Browse files
committed
Fixes missing component import func on dev tools
1 parent 97ba024 commit 2356dbd

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

doc/100-General/10-Changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ Released closed milestones can be found on [GitHub](https://github.com/Icinga/ic
1414
[Issue and PRs](https://github.com/Icinga/icinga-powershell-framework/milestone/24?closed=1)
1515

1616
* [#519](https://github.com/Icinga/icinga-powershell-framework/pull/519) Fixes missing loading of Icinga for Windows modules, which is required to ensure an Icinga for Windows environment is providing all commands and variables to a session, allowing other modules to access these information
17+
* [#520](https://github.com/Icinga/icinga-powershell-framework/pull/520) Adds missing `Import-IcingaPowerShellComponent` function while creating new components by using the developer tools
1718

1819
## 1.9.0 (2022-05-03)
1920

lib/core/dev/New-IcingaForWindowsComponent.psm1

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,13 @@ function New-IcingaForWindowsComponent()
7171
New-Item -ItemType File -Path (Join-Path -Path $ModuleDir -ChildPath 'README.md') | Out-Null;
7272
New-Item -ItemType File -Path (Join-Path -Path $ModuleDir -ChildPath ([string]::Format('{0}.psm1', $ModuleName))) | Out-Null;
7373

74+
$ModuleMainFile = Join-Path -Path $ModuleDir -ChildPath ([string]::Format('{0}.psm1', $ModuleName));
75+
76+
Set-Content -Path $ModuleMainFile -Value ([string]::Format('function Import-IcingaPowerShellComponent{0}()', $TextInfo.ToTitleCase($Name)));
77+
Add-Content -Path $ModuleMainFile -Value '{';
78+
Add-Content -Path $ModuleMainFile -Value '';
79+
Add-Content -Path $ModuleMainFile -Value '}';
80+
7481
switch ($ComponentType) {
7582
'plugins' {
7683
New-Item -ItemType Directory -Path (Join-Path -Path $ModuleDir -ChildPath 'plugins') | Out-Null;

0 commit comments

Comments
 (0)