After enabling JEA I expected the hyper-v plugins to work fine.
Current Behavior
No plugin was working anymore.
Steps to Reproduce (for bugs)
Install Framework (1.8.0)
Install Plugins (1.8.0)
Install all other available components
Enable JEA with Managed user
Context
This gives out an error:
[Error]: Unable to include module "icinga-powershell-hyperv" into JEA profile. The file "C:\Program Files\WindowsPowerShell\Modules\icinga-powershell-hyperv\1.0.0\provider\vcomputer\Get-IcingaVirtualComputerInfo.psm1" is using one or more [ScriptBlock] variables which are forbidden in JEA context.
So I tried to manually enable script-blocks:
Install-IcingaSecurity -AllowScriptBlocks
Did actually not work out as alll checks went into UNKNOWN.
[UNKNOWN] Icinga Exception: Unable to start the PowerShell.exe with the provided JEA profile "IcingaForWindows" for CheckCommand:
Also the uninstallation gives out an error (but worked):
[Error]: Failed to remove items from path "C:\Users\icinga". Recurse is "True", Force is "True": "System.UnauthorizedAccessException: Der Zugriff auf den Pfad "C:\Users\icinga\Anwendungsdaten" wurde verweigert.
bei System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
bei System.IO.FileSystemEnumerableIterator`1.CommonInit()
bei System.IO.FileSystemEnumerableIterator`1..ctor(String path, String originalUserPath, String searchPattern, SearchOption searchOption, SearchResultHandler`1 resultHandler, Boolean checkHost)
bei System.IO.DirectoryInfo.EnumerateDirectories()
bei Microsoft.PowerShell.Commands.FileSystemProvider.RemoveDirectoryInfoItem(DirectoryInfo directory, Boolean recurse, Boolean force, Boolean rootOfRemoval)
bei Microsoft.PowerShell.Commands.FileSystemProvider.RemoveDirectoryInfoItem(DirectoryInfo directory, Boolean recurse, Boolean force, Boolean rootOfRemoval)
bei Microsoft.PowerShell.Commands.FileSystemProvider.RemoveItem(String path, Boolean recurse)"
Your Environment
PowerShell Version used ($PSVersionTable.PSVersion):
Major Minor Build Revision
----- ----- ----- --------
5 1 20348 320
Operating System and version (Get-IcingaWindowsInformation Win32_OperatingSystem | Select-Object Version, BuildNumber, Caption):
Version BuildNumber Caption
------- ----------- -------
10.0.20348 20348 Microsoft Windows Server 2022 Standard
thank you for the issue. I moved it to the Hyper-V plugin collection. This issue is already fixed with v1.1.0, which we hopefully will be releasing soon.
Afterwards this problem is gone.
Expected Behavior
After enabling JEA I expected the hyper-v plugins to work fine.
Current Behavior
No plugin was working anymore.
Steps to Reproduce (for bugs)
Context
This gives out an error:
[Error]: Unable to include module "icinga-powershell-hyperv" into JEA profile. The file "C:\Program Files\WindowsPowerShell\Modules\icinga-powershell-hyperv\1.0.0\provider\vcomputer\Get-IcingaVirtualComputerInfo.psm1" is using one or more [ScriptBlock] variables which are forbidden in JEA context.
So I tried to manually enable script-blocks:
Install-IcingaSecurity -AllowScriptBlocks
Did actually not work out as alll checks went into UNKNOWN.[UNKNOWN] Icinga Exception: Unable to start the PowerShell.exe with the provided JEA profile "IcingaForWindows" for CheckCommand:
Also the uninstallation gives out an error (but worked):
Your Environment
$PSVersionTable.PSVersion
):Get-IcingaWindowsInformation Win32_OperatingSystem | Select-Object Version, BuildNumber, Caption
):Best regards