Import Statement Order
TIP
- When adding
Import-Module PSCompletionsto your$Profile, its position matters. - In some cases, incorrect import order may cause
PSCompletionsto not work properly.
If you need to use
PSReadLinerelated configuration commands- Place them before
Import-Module PSCompletions
powershell# Get-PSReadLineOption $params = @{ # InlineView/ListView PredictionViewStyle = 'ListView' # Audible/Visual/None BellStyle = 'None' # Windows/Emacs/Vi EditMode = 'Vi' } Set-PSReadLineOption @params Set-PSReadLineKeyHandler -Key 'Ctrl+z' -Function Undo Import-Module PSCompletionspowershell# Get-PSReadLineOption Set-PSReadLineOption -PredictionViewStyle ListView -BellStyle None -EditMode vi Set-PSReadLineKeyHandler -Key 'Ctrl+z' -Function Undo Import-Module PSCompletions- Place them before