Streamline PowerShell installation
This commit is contained in:
parent
6ab0df4dc8
commit
ea83940e39
1 changed files with 25 additions and 11 deletions
|
@ -164,25 +164,39 @@ $null = New-Module {
|
|||
continue;
|
||||
}
|
||||
|
||||
Invoke-Hook "Install-PSModules" -Fallback {
|
||||
$modules = @(
|
||||
@("KnownFolders"),
|
||||
@("PSWindowsUpdate"),
|
||||
@("PSScriptAnalyzer"),
|
||||
@("LocalAccounts", $true),
|
||||
@("NuGet")
|
||||
);
|
||||
|
||||
foreach ($module in $modules) {
|
||||
$parameters = @{ };
|
||||
|
||||
if ($module[1]) {
|
||||
$parameters = @{
|
||||
allowPrerelease = $true;
|
||||
};
|
||||
}
|
||||
|
||||
Install-Module -Scope AllUsers -AcceptLicense -Force $module[0] @parameters;
|
||||
Import-Module $module[0];
|
||||
}
|
||||
|
||||
. "$PSScriptRoot/../Software/PinnedItem/Manage.ps1";
|
||||
};
|
||||
|
||||
if (-not (Test-PSPackage Selenium.WebDriver)) {
|
||||
Write-Host "Installing browser automation tools…";
|
||||
Install-Module -AcceptLicense -Force NuGet;
|
||||
Import-Module NuGet;
|
||||
$null = Install-Package -Force Selenium.WebDriver -RequiredVersion 4.10.0 -SkipDependencies;
|
||||
continue;
|
||||
}
|
||||
|
||||
Install-ChocoPackage selenium-gecko-driver firefox;
|
||||
|
||||
Invoke-Hook "Install-PSModules" -Fallback {
|
||||
Install-Module -Scope AllUsers -AcceptLicense -Force KnownFolders;
|
||||
Install-Module -Scope AllUsers -AcceptLicense -Force PSWindowsUpdate;
|
||||
Install-Module -Scope AllUsers -AcceptLicense -Force PSScriptAnalyzer;
|
||||
Install-Module -Scope AllUsers -AcceptLicense -AllowPrerelease -AllowClobber -Force LocalAccounts;
|
||||
Import-Module LocalAccounts;
|
||||
. "$PSScriptRoot/../Software/PinnedItem/Manage.ps1";
|
||||
};
|
||||
|
||||
Install-WingetPackage AutoHotkey.AutoHotkey;
|
||||
Set-Stage ([SetupStage]::Configure);
|
||||
break;
|
||||
|
|
Loading…
Reference in a new issue