I am trying to emulate bash's source command in powershell. The intent is to make any change to my microsoft.powershell_profile.psl and source it into the existing instance of powershell.
The following command works in command-line
$profile_content = [string]::join([environment]::newline,(get-content $profile))
invoke-expression $profile_content
All is good; I put the same into microsoft.powershell_profile.psl and it does not work.
function source{
$profile_content = [string]::join([environment]::newline,(get-content $args[0]))
invoke-expression $profile_content
}
Am I overlooking something?
$profileand$args[0]?