Make Operations
script cross platform
This commit is contained in:
parent
6182ff2c8f
commit
06da905646
|
@ -196,18 +196,40 @@ $null = New-Module {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (-not (Test-PSPackage Selenium.WebDriver)) {
|
||||||
|
Write-Host "Installing browser automation tools…";
|
||||||
|
$null = Install-Package -Force Selenium.WebDriver -RequiredVersion 4.10.0 -SkipDependencies;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
Install-ChocoPackage selenium-gecko-driver firefox;
|
||||||
|
Install-WingetPackage AutoHotkey.AutoHotkey;
|
||||||
|
. "$PSScriptRoot/../../Windows/Software/PinnedItem/Manage.ps1";
|
||||||
|
}
|
||||||
|
|
||||||
Invoke-Hook "Install-PSModules" -Fallback {
|
Invoke-Hook "Install-PSModules" -Fallback {
|
||||||
$modules = @(
|
$modules = @(
|
||||||
|
@("PSScriptAnalyzer")
|
||||||
|
) + (& {
|
||||||
|
if (-not $IsWindows) {
|
||||||
|
@()
|
||||||
|
} else {
|
||||||
|
@(
|
||||||
@("KnownFolders"),
|
@("KnownFolders"),
|
||||||
@("PSWindowsUpdate"),
|
@("PSWindowsUpdate"),
|
||||||
@("PSScriptAnalyzer"),
|
|
||||||
@("LocalAccounts", $true),
|
@("LocalAccounts", $true),
|
||||||
@("NuGet")
|
@("NuGet")
|
||||||
);
|
)
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
foreach ($module in $modules) {
|
foreach ($module in $modules) {
|
||||||
$parameters = @{ };
|
$parameters = @{ };
|
||||||
|
|
||||||
|
if ($module -is [string]) {
|
||||||
|
$module = @($module);
|
||||||
|
}
|
||||||
|
|
||||||
if ($module[1]) {
|
if ($module[1]) {
|
||||||
$parameters = @{
|
$parameters = @{
|
||||||
allowPrerelease = $true;
|
allowPrerelease = $true;
|
||||||
|
@ -219,23 +241,12 @@ $null = New-Module {
|
||||||
Import-Module $module[0];
|
Import-Module $module[0];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
. "$PSScriptRoot/../../Windows/Software/PinnedItem/Manage.ps1";
|
|
||||||
};
|
};
|
||||||
|
|
||||||
if (-not (Test-PSPackage Selenium.WebDriver)) {
|
|
||||||
Write-Host "Installing browser automation tools…";
|
|
||||||
$null = Install-Package -Force Selenium.WebDriver -RequiredVersion 4.10.0 -SkipDependencies;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
Install-ChocoPackage selenium-gecko-driver firefox;
|
|
||||||
Install-WingetPackage AutoHotkey.AutoHotkey;
|
|
||||||
$initialized = $true;
|
$initialized = $true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if ($taskPending) {
|
if ($taskPending) {
|
||||||
Start-OneShot;
|
Start-OneShot;
|
||||||
|
@ -383,6 +394,8 @@ $null = New-Module {
|
||||||
Clears resources allocated during the operation.
|
Clears resources allocated during the operation.
|
||||||
#>
|
#>
|
||||||
function Clear-OperationResources {
|
function Clear-OperationResources {
|
||||||
|
if ($IsWindows) {
|
||||||
Uninstall-WslDistribution;
|
Uninstall-WslDistribution;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue