Fix profile script for individual profiles
This commit is contained in:
parent
e9be3db64e
commit
ec5ccfba2d
1 changed files with 17 additions and 1 deletions
|
@ -83,7 +83,7 @@ $null = New-Module {
|
|||
}
|
||||
|
||||
if ($Category) {
|
||||
$profiles = $profiles | ForEach-Object { Join-Path (Split-Path -Parent $_) "conf.d" "$Category.ps1" };
|
||||
$profiles = @($profiles | ForEach-Object { Join-Path (Split-Path -Parent $_) "conf.d" "$Category.ps1" });
|
||||
}
|
||||
|
||||
$profiles | ForEach-Object {
|
||||
|
@ -102,4 +102,20 @@ $null = New-Module {
|
|||
-Script $Script;
|
||||
};
|
||||
}
|
||||
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Creates an eval-script using the `[scriptblock]::Create` method.
|
||||
|
||||
.PARAMETER Initializer
|
||||
The code to evaluate.
|
||||
#>
|
||||
function Get-ScriptInitializer {
|
||||
param (
|
||||
[Parameter(Position=0, Mandatory=$true)]
|
||||
$Initializer
|
||||
)
|
||||
|
||||
return ". ([scriptblock]::Create(($Initializer) -join `"``n`"))";
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue