diff --git a/scripts/Windows/Scripts/Software.ps1 b/scripts/Windows/Scripts/Software.ps1 index 22f2bc8c..d00f66e9 100644 --- a/scripts/Windows/Scripts/Software.ps1 +++ b/scripts/Windows/Scripts/Software.ps1 @@ -9,6 +9,20 @@ enum InstallerAction { $null = New-Module { $userArgument = "name"; + <# + .SYNOPSIS + Gets the name of the software. + #> + function Get-SoftwareName { + $path = ${Function:Install-Software}.File; + + if ($path -ne "$PSCommandPath") { + Split-Path -Leaf (Split-Path -Parent $path); + } else { + $null; + } + } + <# .SYNOPSIS Installs the software. @@ -41,9 +55,19 @@ $null = New-Module { [hashtable] $Arguments ) + $null = $softwareName; + + if ($null -ne (Get-SoftwareName)) { + $softwareName = "``$(Get-SoftwareName)``"; + } else { + $softwareName = "unknown software"; + } + if (($null -eq $Action) -or ($action -eq ([InstallerAction]::Install))) { + Write-Host "Installing $softwareName…"; Install-Software @Arguments; } elseif ($action -eq ([InstallerAction]::Configure)) { + Write-Host "Configuring $softwareName…"; Set-SoftwareConfiguration @Arguments; foreach ($user in Get-Users) { @@ -56,6 +80,7 @@ $null = New-Module { $Arguments.Add($userArgument, ($env:UserName)); } + Write-Host "Configuring $softwareName for user ``$($Arguments[$userArgument])``…"; Set-SoftwareUserConfiguration @Arguments; } }