-
Notifications
You must be signed in to change notification settings - Fork 7.7k
Closed
Labels
Breaking-Changebreaking change that may affect usersbreaking change that may affect usersCommittee-ReviewedPS-Committee has reviewed this and made a decisionPS-Committee has reviewed this and made a decisionIssue-Discussionthe issue may not have a clear classification yet. The issue may generate an RFC or may be reclassifthe issue may not have a clear classification yet. The issue may generate an RFC or may be reclassifResolution-FixedThe issue is fixed.The issue is fixed.Up-for-GrabsUp-for-grabs issues are not high priorities, and may be opportunities for external contributorsUp-for-grabs issues are not high priorities, and may be opportunities for external contributorsWG-Languageparser, language semanticsparser, language semantics
Description
Note:
- Changing this would technically be a breaking change and/or may be undesirable for performance reasons, in which case the issue should be documented.
When converting from strings,
-
PowerShell currently DOES recognize binary-multiplier suffixes such as
kb
,mb
, ...:- in expressions (e.g.,
'1gb' / 1
)
- in expressions (e.g.,
-
but DOES NOT recognize them:
-
during implicit type conversion in then context of parameter binding (e.g.,
& { param([int] $foo) } '1gb'
) -
(perhaps less surprisingly) in explicit type conversions with casts (e.g.,
[int] '1gb'
)
-
Update: The same applies to PowerShell's number-data-type suffixes such as d
for [decimal]
and l
for [long]
.
Environment data
Written as of:
PowerShell Core 6.1.0-preview.4
Metadata
Metadata
Assignees
Labels
Breaking-Changebreaking change that may affect usersbreaking change that may affect usersCommittee-ReviewedPS-Committee has reviewed this and made a decisionPS-Committee has reviewed this and made a decisionIssue-Discussionthe issue may not have a clear classification yet. The issue may generate an RFC or may be reclassifthe issue may not have a clear classification yet. The issue may generate an RFC or may be reclassifResolution-FixedThe issue is fixed.The issue is fixed.Up-for-GrabsUp-for-grabs issues are not high priorities, and may be opportunities for external contributorsUp-for-grabs issues are not high priorities, and may be opportunities for external contributorsWG-Languageparser, language semanticsparser, language semantics