PortValhalla/scripts/Windows/Scripts/Prerequisites.ps1

33 lines
971 B
PowerShell
Raw Normal View History

2023-07-12 20:37:31 +00:00
#!/bin/pwsh
2023-07-29 01:37:43 +00:00
. "$PSScriptRoot/Context.ps1";
2023-07-19 07:54:45 +00:00
$Global:InformationPreference = "Continue";
$Global:ErrorActionPreference = "Inquire";
2023-07-29 01:37:43 +00:00
[Context]::new().PreventSleepMode();
2023-07-19 07:53:11 +00:00
$null = powershell -c Get-PackageProvider -ListAvailable NuGet;
if (-not $?) {
2023-07-19 07:48:08 +00:00
Write-Host "Installing NuGet PackageProvider";
2023-07-20 08:18:43 +00:00
powershell -c '$null = Install-PackageProvider -Name NuGet -Force';
}
foreach ($module in @("PSWindowsUpdate", "KnownFolders"))
{
2023-06-22 15:22:45 +00:00
if (-not (Get-Module -ListAvailable $module))
{
2023-07-19 07:48:08 +00:00
Write-Host "Installing PowerShell Module $module";
Install-Module -AcceptLicense -Force "$module";
}
}
2023-06-22 15:27:43 +00:00
2023-07-18 18:04:34 +00:00
foreach ($nativeModule in @("PinnedItem")) {
if (-not (powershell -c Get-Module -ListAvailable $nativeModule)) {
2023-07-19 07:48:08 +00:00
Write-Host "Installing Windows PowerShell Module $nativeModule";
2023-07-18 19:41:47 +00:00
powershell -c Install-Module -Force "$nativeModule";
2023-07-18 18:04:34 +00:00
}
}
2023-07-30 12:33:02 +00:00
2023-07-31 23:04:49 +00:00
if (-not (Get-Command 7z -ErrorAction SilentlyContinue)) {
2023-07-30 12:33:02 +00:00
choco install -y 7zip.portable;
}