powershell でbash のsourceコマンドをエミュレートしようとしています。その意図は、my に変更を加え、microsoft.powershell_profile.psl
それを既存の powershell インスタンスにソースすることです。
次のコマンドはコマンドラインで機能します
$profile_content = [string]::join([environment]::newline,(get-content $profile))
invoke-expression $profile_content
すべてが良いです; 私は同じものを入れましたが、うまくいきmicrosoft.powershell_profile.psl
ません。
function source{
$profile_content = [string]::join([environment]::newline,(get-content $args[0]))
invoke-expression $profile_content
}
私は何かを見落としていますか?