Add a script for installing WinSCP

This commit is contained in:
Manuel Thalmann 2024-08-07 18:30:14 +02:00
parent fc4215b341
commit a11646372a
2 changed files with 39 additions and 6 deletions

View file

@ -172,13 +172,21 @@ $null = New-Module {
} }
}; };
$null = New-Module {
# Windows Config # Windows Config
. "$PSScriptRoot/../Software/Windows/Manage.ps1" @arguments; $softwarePath = "$PSScriptRoot/../Software";
. "$softwarePath/Windows/Manage.ps1" @arguments;
if (Test-Collection "essential") { if (Test-Collection "essential") {
# Essentials # Essentials
. "$PSScriptRoot/../Software/OpenSSH/Manage.ps1" @arguments; . "$softwarePath/OpenSSH/Manage.ps1" @arguments;
} }
if (Test-Collection "common") {
# Common Software
. "$softwarePath/WinSCP/Manage.ps1" @arguments;
}
};
} }
switch (Get-Stage) { switch (Get-Stage) {

View file

@ -0,0 +1,25 @@
using namespace Microsoft.Win32;
param(
$Action,
[hashtable] $Arguments
)
. "$PSScriptRoot/../../Scripts/AppAssociations.ps1";
. "$PSScriptRoot/../../Scripts/Software.ps1";
. "$PSScriptRoot/../../Scripts/System.ps1";
Start-SoftwareInstaller @PSBoundParameters `
-Installer {
param(
[scriptblock] $Installer
)
Install-ChocoPackage winscp;
& $Installer -Action ([InstallerAction]::Configure)
} `
-Configurator {
Remove-DesktopIcon "WinSCP*";
Write-Host "Making WinSCP the default FTP program…";
Set-DefaultAppAssociation -Identifier "ftp" -ProgId "WinSCP.Url" -ApplicationName "WinSCP: SFTP, FTP, WebDAV, S3 and SCP client";
};