diff --git a/scripts/Windows/Config/PowerShell/Install.ps1 b/scripts/Windows/Config/PowerShell/Install.ps1 index 33a7f417..511b4873 100644 --- a/scripts/Windows/Config/PowerShell/Install.ps1 +++ b/scripts/Windows/Config/PowerShell/Install.ps1 @@ -5,4 +5,10 @@ param($context) Write-Host "Configuring PowerShell"; Write-Information "Allow addition of any number of profile files"; [Context] $context = $context; -$context.AddPowerShellProfileStatement('. "$PSScriptRoot/profile.d/*.ps1";'); + +$context.AddPowerShellProfileStatement( + @( + '$profilePath = "$PSScriptRoot/profile.d/*.ps1";', + 'if (Test-Path $profilePath) {', + ' . $profilePath;', + '}') -join ([System.Environment]::NewLine));