Only load profile files if existent
This commit is contained in:
parent
b44c8833b5
commit
2a7e0b643e
1 changed files with 7 additions and 1 deletions
|
@ -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));
|
||||
|
|
Loading…
Reference in a new issue