You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We should be able to set the maximum history count with Set-PSReadlineOption in a profile script.
Actual behavior
But when you put the same command in a PowerShell profile script, the parameter is ignored. Although if you set something like -HistoryNoDuplicates or -HistorySearchCaseSensitive those settings will be configured through the profile script. Get-PSReadlineOption shows the default value for MaximumHistoryCount.
Environment data
Name Value
---------
PSVersion 5.1.16275.1000
PSEdition Desktop
PSCompatibleVersions {1.0,2.0,3.0,4.0...}
BuildVersion 10.0.16275.1000
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
I get similar results in beta-6 on Linux.
The text was updated successfully, but these errors were encountered:
After a quick exchange with @lzybkr it appears that the built-in PowerShell variable $MaximumHistoryCount over rides any setting you make with Set-PSReadLineOption. If I set $MaximumHistoryCount in my profile, that is the value that PSReadline uses. So I guess this isn't a bug. BUT since this feature is ignored, it should be deprecated or at least have the documentation updated.
Steps to reproduce
Open a PowerShell console and run
Get-PSReadlineOption confirms the change.
Expected behavior
We should be able to set the maximum history count with Set-PSReadlineOption in a profile script.
Actual behavior
But when you put the same command in a PowerShell profile script, the parameter is ignored. Although if you set something like -HistoryNoDuplicates or -HistorySearchCaseSensitive those settings will be configured through the profile script. Get-PSReadlineOption shows the default value for MaximumHistoryCount.
Environment data
I get similar results in beta-6 on Linux.
The text was updated successfully, but these errors were encountered: