Renames uninstaller arg Component to Name

This commit is contained in:
Lord Hepipud 2021-02-24 15:12:14 +01:00
parent 7d3ac7ef08
commit 433511597e
2 changed files with 4 additions and 4 deletions

View file

@ -55,7 +55,7 @@ function Uninstall-IcingaForWindows()
foreach ($module in $ModuleList.Name) { foreach ($module in $ModuleList.Name) {
[string]$ModuleName = $module.Replace('icinga-powershell-', ''); [string]$ModuleName = $module.Replace('icinga-powershell-', '');
if ((Uninstall-IcingaFrameworkComponent -Component $ModuleName)) { if ((Uninstall-IcingaFrameworkComponent -Name $ModuleName)) {
continue; continue;
} }

View file

@ -8,7 +8,7 @@
.FUNCTIONALITY .FUNCTIONALITY
Uninstalls a specific module within the icinga-powershell-* namespace Uninstalls a specific module within the icinga-powershell-* namespace
inside your PowerShell module folder inside your PowerShell module folder
.PARAMETER Component .PARAMETER Name
The component you want to uninstall, like 'plugins' or 'mssql' The component you want to uninstall, like 'plugins' or 'mssql'
.INPUTS .INPUTS
System.String System.String
@ -21,11 +21,11 @@
function Uninstall-IcingaFrameworkComponent() function Uninstall-IcingaFrameworkComponent()
{ {
param ( param (
[string]$Component [string]$Name = ''
); );
$ModuleBase = Get-IcingaFrameworkRootPath; $ModuleBase = Get-IcingaFrameworkRootPath;
$UninstallComponent = [string]::Format('icinga-powershell-{0}', $Component); $UninstallComponent = [string]::Format('icinga-powershell-{0}', $Name);
$UninstallPath = Join-Path -Path $ModuleBase -ChildPath $UninstallComponent; $UninstallPath = Join-Path -Path $ModuleBase -ChildPath $UninstallComponent;
if ((Test-Path $UninstallPath) -eq $FALSE) { if ((Test-Path $UninstallPath) -eq $FALSE) {