From a094ec86baa2b4fa192fd2a88fe74015bb149470 Mon Sep 17 00:00:00 2001 From: Nathan Windisch Date: Thu, 25 Jul 2024 15:08:40 +0100 Subject: [PATCH] chore: Update PSGraylog module installation script to install required modules (if they're not installed already) --- Install.ps1 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Install.ps1 b/Install.ps1 index 2f1ba81..e9ed474 100644 --- a/Install.ps1 +++ b/Install.ps1 @@ -1,6 +1,10 @@ # Defaults to the first module path, however you can change this to any path you wish (provided it's in your $PSModulePath) $ModulePath = $env:PSModulePath.Split(";")[0] -if (-NOT (Test-Path $ModulePath)) { New-Item -Path $ModulePath -ItemType Directory } # Create the module path if it doesn't exist (might happen on brand new installs) +if (-NOT (Test-Path $ModulePath)) { $null = New-Item -Path $ModulePath -ItemType Directory } # Create the module path if it doesn't exist (might happen on brand new installs) + +$RequiredModules = @("Microsoft.PowerShell.SecretStore","Microsoft.PowerShell.SecretManagement").Where{ -NOT (Get-Module $_ -ListAvailable) -as [bool] } +$RequiredModules.ForEach{Install-Module $_ } + $GitURI = "https://git.wnd.sh/n/PSGraylog/archive/main.zip" $OutputPath = "$ModulePath/PSGraylog"