Character encoding (UTF-8) in PowerShell session [duplicate] Character encoding (UTF-8) in PowerShell session [duplicate] windows windows

Character encoding (UTF-8) in PowerShell session [duplicate]


You could use PowerShell profiles. PowerShell supports several profile files. Also, PowerShell host programs can support their own host-specific profiles.

For example, the PowerShell console supports the following basic profile files. The profiles are listed in precedence order. The first profile has the highest precedence.

THE PROFILE FILESDescription                  PathAll Users,     All Hosts     $PSHOME\Profile.ps1All Users,     Current Host  $PSHOME\Microsoft.PowerShell_profile.ps1Current User,  All Hosts     $Home\[My ]Documents\PowerShell\Profile.ps1Current user,  Current Host  $Home\[My ]Documents\PowerShell\Microsoft.PowerShell_profile.ps1

The profile paths include the following variables:

  • The $PSHOME variable, which stores the installation directory for PowerShell

  • The $Home variable, which stores the current user's home directory

From the following article, if you wish to read more about this,
https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_profiles?view=powershell-7.1&viewFallbackFrom=powershell-7.