2023-07-12 20:37:31 +00:00
|
|
|
#!/bin/pwsh
|
2023-06-16 18:24:22 +00:00
|
|
|
. "$PSScriptRoot/Manage.ps1";
|
2023-06-22 15:06:45 +00:00
|
|
|
. "$PSScriptRoot/Upgrade.ps1";
|
2023-06-22 20:56:43 +00:00
|
|
|
. "$PSScriptRoot/User.ps1";
|
2023-06-22 15:53:12 +00:00
|
|
|
. "$PSScriptRoot/../Scripts/Context.ps1";
|
2023-06-16 18:24:22 +00:00
|
|
|
|
2023-06-21 20:04:18 +00:00
|
|
|
function Invoke-WindowsInstallation([Context] $context)
|
|
|
|
{
|
2023-06-22 15:32:36 +00:00
|
|
|
Write-Host "Starting Installation and Restoration of Windows";
|
2023-06-21 20:04:18 +00:00
|
|
|
. "$PSScriptRoot/../Scripts/Prerequisites.ps1";
|
2023-06-30 10:19:54 +00:00
|
|
|
Update-WindowsInstallation $context;
|
2023-07-14 07:24:13 +00:00
|
|
|
|
2023-07-15 16:24:26 +00:00
|
|
|
if (-not $context.Get("SoftwarePrerequisitesInstalled")) {
|
|
|
|
Write-Host "Installing prerequisites for installing software";
|
|
|
|
|
2023-07-15 16:45:44 +00:00
|
|
|
Install-Module -AcceptLicense -Force "NuGet";
|
2023-07-15 16:24:26 +00:00
|
|
|
Import-Module NuGet;
|
|
|
|
|
2023-07-15 17:18:56 +00:00
|
|
|
choco install -y firefox selenium-gecko-driver;
|
2023-07-15 16:24:26 +00:00
|
|
|
Install-Package -Force Selenium.WebDriver -SkipDependencies;
|
|
|
|
|
2023-07-15 23:27:38 +00:00
|
|
|
$context.Set("SoftwarePrerequisitesInstalled", 1, "DWord");
|
2023-07-15 16:24:26 +00:00
|
|
|
}
|
2023-07-14 07:24:13 +00:00
|
|
|
|
|
|
|
if (-not $context.Get("DriversInstalled")) {
|
|
|
|
Write-Host "Installing Drivers";
|
|
|
|
Write-Information "Looking for driver installation function";
|
|
|
|
|
2023-07-15 09:33:42 +00:00
|
|
|
if ((Get-Command Install-PortValhallaDrivers -ErrorAction SilentlyContinue)) {
|
2023-07-14 07:24:13 +00:00
|
|
|
Write-Information "Driver installation function was found. Starting installation";
|
2023-07-15 09:33:42 +00:00
|
|
|
Install-PortValhallaDrivers $context;
|
2023-07-14 07:24:13 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
Write-Information "Finished installing drivers";
|
2023-07-15 23:27:38 +00:00
|
|
|
$context.Set("DriversInstalled", 1, "DWord");
|
2023-07-15 19:40:14 +00:00
|
|
|
$context.Reboot();
|
|
|
|
exit;
|
2023-07-14 07:24:13 +00:00
|
|
|
}
|
|
|
|
|
2023-06-22 20:56:43 +00:00
|
|
|
New-PersonalUser $context;
|
2023-06-30 10:19:54 +00:00
|
|
|
Restore-WindowsInstallation $context;
|
2023-06-21 20:04:18 +00:00
|
|
|
}
|