PowerShell: Manage PowerShell Profiles

By Xah Lee. Date: . Last updated: .

Managing PowerShell Profiles

if you have a lot PowerShell functions, you can separate into different files.

For example, in your profile file, add

. '~/git/xahscripts/xah_PowerShell/xah_powershell_profile.ps1'

then, in that file, add

@(
    "xah_powershell_file_rename.ps1",
    "xah_powershell_line_ending.ps1",
    "xah_powershell_file_util.ps1",
    "xah_powershell_windows_util.ps1",
    "xah_powershell_personal.ps1"
) | ForEach-Object {
    . (Join-Path (Split-Path -Parent $PSCommandPath ) $_ )
}

PowerShell: Profile and Script