mirror of
https://github.com/Icinga/icinga-powershell-framework.git
synced 2025-12-21 15:19:58 -05:00
21 lines
824 B
PowerShell
21 lines
824 B
PowerShell
|
|
function Uninstall-IcingaJEAProfile()
|
||
|
|
{
|
||
|
|
$JeaProfile = Join-Path -Path (Get-IcingaFrameworkRootPath) -ChildPath 'IcingaForWindows.pssc';
|
||
|
|
$JeaProfileRessource = Join-Path -Path (Get-IcingaFrameworkRootPath) -ChildPath 'RoleCapabilities\IcingaForWindows.psrc';
|
||
|
|
|
||
|
|
if (Test-Path $JeaProfile) {
|
||
|
|
Write-IcingaConsoleNotice 'Removing JEA profile';
|
||
|
|
Remove-Item $JeaProfile -Force;
|
||
|
|
}
|
||
|
|
|
||
|
|
if (Test-Path $JeaProfileRessource) {
|
||
|
|
Write-IcingaConsoleNotice 'Removing JEA profile ressource';
|
||
|
|
Remove-Item $JeaProfileRessource -Force;
|
||
|
|
}
|
||
|
|
|
||
|
|
Write-IcingaConsoleNotice 'Removing JEA profile registration';
|
||
|
|
Unregister-PSSessionConfiguration -Name 'IcingaForWindows' -Force -ErrorAction SilentlyContinue;
|
||
|
|
|
||
|
|
Set-IcingaPowerShellConfig -Path 'Framework.JEAProfile' -Value '';
|
||
|
|
}
|