diff --git a/scripts/Windows/OS/Install.ps1 b/scripts/Windows/OS/Install.ps1 index 48a41583..27d790a1 100644 --- a/scripts/Windows/OS/Install.ps1 +++ b/scripts/Windows/OS/Install.ps1 @@ -172,13 +172,21 @@ $null = New-Module { } }; - # Windows Config - . "$PSScriptRoot/../Software/Windows/Manage.ps1" @arguments; + $null = New-Module { + # Windows Config + $softwarePath = "$PSScriptRoot/../Software"; + . "$softwarePath/Windows/Manage.ps1" @arguments; - if (Test-Collection "essential") { - # Essentials - . "$PSScriptRoot/../Software/OpenSSH/Manage.ps1" @arguments; - } + if (Test-Collection "essential") { + # Essentials + . "$softwarePath/OpenSSH/Manage.ps1" @arguments; + } + + if (Test-Collection "common") { + # Common Software + . "$softwarePath/WinSCP/Manage.ps1" @arguments; + } + }; } switch (Get-Stage) { diff --git a/scripts/Windows/Software/WinSCP/Manage.ps1 b/scripts/Windows/Software/WinSCP/Manage.ps1 new file mode 100644 index 00000000..150fc1af --- /dev/null +++ b/scripts/Windows/Software/WinSCP/Manage.ps1 @@ -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"; + };