Skip to content

Commit 01a4a80

Browse files
committed
Adds support to create snapshot repositories with "New-IcingaRepository"
1 parent c7eeab8 commit 01a4a80

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

doc/100-General/10-Changelog.md

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ Released closed milestones can be found on [GitHub](https://github.com/Icinga/ic
2020

2121
### Enhancements
2222

23+
* [#587](https://github.com/Icinga/icinga-powershell-framework/issues/587) Adds support to create own snapshot repositories with `New-IcingaRepository`
2324
* [#631](https://github.com/Icinga/icinga-powershell-framework/pull/631) Deduplicates `-C try { Use-Icinga ...` boilerplate by adding it to the `PowerShell Base` template and removing it from every single command
2425
* [#679](https://github.com/Icinga/icinga-powershell-framework/pull/679) Adds a new data provider for fetching process information of Windows systems, while sorting all objects based on a process name and their process id
2526
* [#688](https://github.com/Icinga/icinga-powershell-framework/pull/688) Adds new handling to add scheduled tasks in Windows for interacting with Icinga for Windows core functionality as well as an auto renewal task for the Icinga for Windows certificate generation

lib/core/repository/New-IcingaRepository.psm1

+3-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ function New-IcingaRepository()
44
[string]$Name = $null,
55
[string]$Path = $null,
66
[string]$RemotePath = $null,
7-
[switch]$Force = $FALSE
7+
[switch]$Force = $FALSE,
8+
[switch]$Snapshot = $FALSE
89
);
910

1011
if ([string]::IsNullOrEmpty($Name)) {
@@ -35,7 +36,7 @@ function New-IcingaRepository()
3536
return;
3637
}
3738

38-
$IcingaRepository = New-IcingaRepositoryFile -Path $Path -RemotePath $RemotePath -Name $Name;
39+
$IcingaRepository = New-IcingaRepositoryFile -Path $Path -RemotePath $RemotePath -Name $Name -SnapshotFile:$Snapshot;
3940

4041
[array]$ConfigCount = $IcingaRepository.Packages.PSObject.Properties.Count;
4142

lib/core/repository/New-IcingaRepositoryFile.psm1

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
function New-IcingaRepositoryFile()
22
{
33
param (
4-
[string]$Path = $null,
5-
[string]$RemotePath = $null,
6-
[string]$Name = ''
4+
[string]$Path = $null,
5+
[string]$RemotePath = $null,
6+
[string]$Name = '',
7+
[switch]$SnapshotFile = $FALSE
78
);
89

910
$RepoFile = 'ifw.repo.json';
@@ -57,7 +58,7 @@ function New-IcingaRepositoryFile()
5758

5859
[bool]$IsSnapshot = $FALSE;
5960

60-
if ($entry.FullName.ToLower() -like '*\master.zip') {
61+
if ($entry.FullName.ToLower() -like '*\master.zip' -Or $SnapshotFile) {
6162
$IsSnapshot = $TRUE;
6263
}
6364

0 commit comments

Comments
 (0)