dfinke / PowerShellHumanizer

PowerShell Humanizer wraps Humanizer: meets all your .NET needs for manipulating and displaying strings, enums, dates, times, timespans, numbers and quantities
Apache License 2.0
120 stars 18 forks source link

ToQuantity issue #10

Open ShaneBateman7 opened 7 years ago

ShaneBateman7 commented 7 years ago

'widgets'.ToQuantity(1,"Words") returns "one widget"

ConvertTo-Quantity -quantity 1 -string "widgets" -showQuantityAs "Words" returns "Words widget" expected output "one widget"

It appears that the ConvertTo-Quantity function is not working as expected Under the covers ConvertTo-Quantity uses [Humanizer.ToQuantityExtensions]::ToQuantity($string, $quantity, $showQuantityAs)

Calling that directly like: [Humanizer.ToQuantityExtensions]::ToQuantity('widget', 1, 'Words') returns "Words widget" expected output "one widget"

Looks like the parameter processing is messed up somehow.