User should not be able to set MaxHistoryCount to unsupported value

Validate that MaxHistoryCount lies within the range of 1-int.maxValue.
This commit is contained in:
Charu Bassi
2016-11-28 17:04:07 -08:00
committed by Jason Shirk
parent b9a5c165e0
commit 166ec54013
+1
View File
@@ -461,6 +461,7 @@ namespace Microsoft.PowerShell
internal SwitchParameter? _historySearchCursorMovesToEnd;
[Parameter(ParameterSetName = "OptionsSet")]
[ValidateRange(1, int.MaxValue)]
public int MaximumHistoryCount
{
get { return _maximumHistoryCount.GetValueOrDefault(); }