このブログは、旧・はてなダイアリー「檜山正幸のキマイラ飼育記 メモ編」(http://d.hatena.ne.jp/m-hiyama-memo/)のデータを移行・保存したものであり、今後(2019年1月以降)更新の予定はありません。

今後の更新は、新しいブログ http://m-hiyama-memo.hatenablog.com/ で行います。

PowerShellのスタートアップファイル群

現状は次のようになっている。

  1. try $PROFILE
  2. C:\Users\hiyama\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1
    1. try $env:HOME\.profile.ps1
    2. try $env:HOME\configs\powershell\.profile.ps1
  3. C:\Users\hiyama\Work\configs\powershell\.profile.ps1
    1. try ${DOTFILES}\.profile.common.ps1
    2. try ${DOTFILES}\.profile.g.$group.ps1
    3. try ${DOTFILES}\.profile.h.$THIS_HOST.ps1
  4. C:\Users\hiyama\Work\configs\powershell\.profile.common.ps1
    1. try $DOTFILES/functions/common.dsrc.ps1
  5. C:\Users\hiyama\Work\configs\powershell/functions/common.dsrc.ps1
  6. C:\Users\hiyama\Work\configs\powershell\.profile.g.desktop.ps1

変更予定

  1. $PROFILE
    1. try ${PS_CONFIG_DIR}\.profile.ps1
  2. ${PS_CONFIG_DIR}\.profile.ps1
    1. try ${PS_CONFIG_DIR}\.profile.common.ps1
    2. try ${PS_CONFIG_DIR}\.profile.g.$GROUP.ps1
    3. try ${PS_CONFIG_DIR}\.profile.h.$THIS_HOST.ps1

この後で、関数を定義したユニット(非公式モジュール)を読み込む。${PS_CONFIG_DIR}/scripts/ とかの下にあるフィルを列挙してソート順に全部読みこむでいいと思う。読み込みは、${PS_CONFIG_DIR}\.profile.ps1 で
行えばいいか。

次で出来るだろう。

ls  ${SCRIPTS_DIR}\*.ps1 | %{$_.fullname} | %{ . $_ }