18 lines
581 B
PowerShell
18 lines
581 B
PowerShell
param(
|
|
[switch]$Force
|
|
)
|
|
$ErrorActionPreference = "Stop"
|
|
foreach ($package in @("XAMPPRocky.Tokei", "AlDanial.Cloc")) {
|
|
$arguments = @("install", "--id", $package, "--exact", "--silent", "--accept-package-agreements", "--accept-source-agreements", "--disable-interactivity")
|
|
if ($Force) {
|
|
$arguments += "--force"
|
|
}
|
|
& winget @arguments
|
|
if ($LASTEXITCODE -ne 0) {
|
|
exit $LASTEXITCODE
|
|
}
|
|
}
|
|
$linkDir = Join-Path $env:LOCALAPPDATA "Microsoft\WinGet\Links"
|
|
& (Join-Path $linkDir "tokei.exe") --version
|
|
& (Join-Path $linkDir "cloc.exe") --version
|