Icinga Powershell kickstart error

Hello Team,

When i run the kickstart command

[Net.ServicePointManager]::SecurityProtocol = “tls12, tls11”;
$ProgressPreference = “SilentlyContinue”;

$global:IcingaFrameworkKickstartSource = ‘https://raw.githubusercontent.com/Icinga/icinga-powershell-kickstart/master/script/icinga-powershell-kickstart.ps1’;

$Script = (Invoke-WebRequest -UseBasicParsing -Uri $global:IcingaFrameworkKickstartSource).Content;
$Script += “rnrn Start-IcingaFrameworkWizard;”;

Invoke-Command -ScriptBlock ([Scriptblock]::Create($Script));

I am getting the following error:

PS C:\WINDOWS\system> [Net.ServicePointManager]::SecurityProtocol = “tls12, tls11”;
PS C:\WINDOWS\system> $ProgressPreference = “SilentlyContinue”;
PS C:\WINDOWS\system>
PS C:\WINDOWS\system> $global:IcingaFrameworkKickstartSource = ‘https://raw.githubusercontent.com/Icinga/icinga-powershell-kickstart/master/script/icinga-powershell-kickstart.ps1’;
PS C:\WINDOWS\system>
PS C:\WINDOWS\system> $Script = (Invoke-WebRequest -UseBasicParsing -Uri $global:IcingaFrameworkKickstartSource).Content;
PS C:\WINDOWS\system> $Script += “rnrn Start-IcingaFrameworkWizard;”;
PS C:\WINDOWS\system>
PS C:\WINDOWS\system> Invoke-Command -ScriptBlock ([Scriptblock]::Create($Script));
Do you provide an own repository for the Icinga PowerShell Framework? (y/N): n
Which version of the Icinga PowerShell Framework do you want to install? (release/snapshot) (Defaults: “release”):
The following directories are available for installing PowerShell modules into:
[0]: C:\Users\Admin\Documents\WindowsPowerShell\Modules
[1]: C:\Program Files\WindowsPowerShell\Modules (Recommended)
[2]: C:\WINDOWS\system\WindowsPowerShell\v1.0\Modules
Where do you want to install the Icinga PowerShell Framework into? ([0-2]) (Defaults: “1”): 1
[Notice]: Downloading Icinga PowerShell Framework into “C:\Users\Admin\AppData\Local\Temp\icinga-powershell-framework-zip”
[Notice]: Installing Icinga PowerShell Framework into “C:\Program Files\WindowsPowerShell\Modules”
It seems that the Icinga PowerShell Framework is already installed. Would you like to update it? (Y/n): y
[Notice]: Importing cache into new Icinga PowerShell Framework version…
[Notice]: Importing custom modules into new Icinga PowerShell Framework version…
[Notice]: Creating backup directory
[Notice]: Importing old backups into new Icinga PowerShell Framework version…
[Notice]: Moving old Icinga PowerShell Framework into backup directory
[Notice]: Installing new Icinga PowerShell Framework version
[Notice]: Unblocking Icinga PowerShell Framework files
[Error]: Unable to load the Icinga PowerShell Framework. Please check your PowerShell execution policies for possible problems. Error: System.Management.Automation.CommandNotFoundException: The ‘Use-Icinga’ command was found in the module ‘icinga-powershell-framework’, but the module could not be loaded. For more information, run ‘Import-Module icinga-powershell-framework’. —> System.Management.Automation.CmdletInvocationException: File C:\Program Files\WindowsPowerShell\Modules\icinga-powershell-framework\icinga-powershell-framework.psm1 cannot be loaded because running scripts is disabled on this system. For more information, see about_Execution_Policies at https:/go.microsoft.com/fwlink/?LinkID=135170. —> System.Management.Automation.PSSecurityException: File C:\Program Files\WindowsPowerShell\Modules\icinga-powershell-framework\icinga-powershell-framework.psm1 cannot be loaded because running scripts is disabled on this system. For more information, see about_Execution_Policies at https:/go.microsoft.com/fwlink/?LinkID=135170. —> System.UnauthorizedAccessException: File C:\Program Files\WindowsPowerShell\Modules\icinga-powershell-framework\icinga-powershell-framework.psm1 cannot be loaded because running scripts is disabled on this system. For more information, see about_Execution_Policies at https:/go.microsoft.com/fwlink/?LinkID=135170.
— End of inner exception stack trace —
at System.Management.Automation.AuthorizationManager.ShouldRunInternal(CommandInfo commandInfo, CommandOrigin origin, PSHost host)
at Microsoft.PowerShell.Commands.ModuleCmdletBase.GetScriptInfoForFile(String fileName, String& scriptName, Boolean checkExecutionPolicy)
at Microsoft.PowerShell.Commands.ModuleCmdletBase.LoadModule(PSModuleInfo parentModule, String fileName, String moduleBase, String prefix, SessionState ss, Object privateData, ImportModuleOptions& options, ManifestProcessingFlags manifestProcessingFlags, Boolean& found, Boolean& moduleFileFound)
at Microsoft.PowerShell.Commands.ModuleCmdletBase.LoadModuleNamedInManifest(PSModuleInfo parentModule, ModuleSpecification moduleSpecification, String moduleBase, Boolean searchModulePath, String prefix, SessionState ss, ImportModuleOptions options, ManifestProcessingFlags manifestProcessingFlags, Boolean loadTypesFiles, Boolean loadFormatFiles, Object privateData, Boolean& found, String shortModuleName, Nullable1 manifestLanguageMode) at Microsoft.PowerShell.Commands.ModuleCmdletBase.LoadModuleManifest(String moduleManifestPath, ExternalScriptInfo manifestScriptInfo, Hashtable data, Hashtable localizedData, ManifestProcessingFlags manifestProcessingFlags, Version minimumVersion, Version maximumVersion, Version requiredVersion, Nullable1 requiredModuleGuid, ImportModuleOptions& options, Boolean& containedErrors)
at Microsoft.PowerShell.Commands.ModuleCmdletBase.LoadModule(PSModuleInfo parentModule, String fileName, String moduleBase, String prefix, SessionState ss, Object privateData, ImportModuleOptions& options, ManifestProcessingFlags manifestProcessingFlags, Boolean& found, Boolean& moduleFileFound)
at Microsoft.PowerShell.Commands.ImportModuleCommand.ImportModule_LocallyViaName(ImportModuleOptions importModuleOptions, String name)
at Microsoft.PowerShell.Commands.ImportModuleCommand.ProcessRecord()
at System.Management.Automation.CommandProcessor.ProcessRecord()
— End of inner exception stack trace —
at System.Management.Automation.Runspaces.PipelineBase.Invoke(IEnumerable input)
at System.Management.Automation.PowerShell.Worker.ConstructPipelineAndDoWork(Runspace rs, Boolean performSyncInvoke)
at System.Management.Automation.PowerShell.CoreInvokeHelper[TInput,TOutput](PSDataCollection1 input, PSDataCollection1 output, PSInvocationSettings settings)
at System.Management.Automation.PowerShell.CoreInvoke[TInput,TOutput](PSDataCollection1 input, PSDataCollection1 output, PSInvocationSettings settings)
at System.Management.Automation.PowerShell.InvokeT
at System.Management.Automation.CommandDiscovery.AutoloadSpecifiedModule(String moduleName, ExecutionContext context, SessionStateEntryVisibility visibility, Exception& exception)
— End of inner exception stack trace —
at System.Management.Automation.ExceptionHandlingOps.CheckActionPreference(FunctionContext funcContext, Exception exception)
at System.Management.Automation.Interpreter.ActionCallInstruction`2.Run(InterpretedFrame frame)
at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)

run the following command right before the kickstart - in the same window!
Set-ExecutionPolicy Bypass -Scope Process

1 Like

Thanks you @nexo1960 that’s works :slightly_smiling_face:

1 Like