Repository navigation
ConvertTo CurrencyTable
Converts a decimal value from one currency to several currencies at once.
ConvertTo-CurrencyTable [-Value] <Decimal> [-From <String>] [-To] <String[]> [-APIKey <String>]
[-Date <DateTime>] [-ProgressAction <ActionPreference>] [<CommonParameters>]
Uses Convert-Currency to convert a value from a source currency (-From) to each of a list of destination currencies (-To), and returns the results as a single object with one property per currency. This avoids having to call Convert-Currency in a loop when you want to compare a value across multiple currencies.
100 | ConvertTo-CurrencyTable -From USD -To GBP,EUR,JPY
Converts 100 USD to GBP, EUR and JPY, and returns the results as a single object with a USD, GBP, EUR and JPY property.
100,200 | ConvertTo-CurrencyTable -From USD -To GBP,EUR
Converts each of 100 and 200 USD to GBP and EUR, returning one object per input value.
Set-CurrencyDefault -From USD
100 | ConvertTo-CurrencyTable -To GBP,EUR
Uses the saved default -From currency to convert 100 to GBP and EUR.
100 | ConvertTo-CurrencyTable -From USD -To GBP,EUR -Date '2024-01-15' -ApiKey yourapikeystringhere
Converts 100 USD to GBP and EUR using the exchange rates as they were on 15th January 2024.
The amount you want to convert between currencies.
Type: Decimal
Parameter Sets: (All)
Aliases:
Required: True
Position: 1
Default value: 0
Accept pipeline input: True (ByValue)
Accept wildcard characters: FalseThe currency to convert from. Defaults to the value saved with Set-CurrencyDefault -From, if any.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: (Get-CurrencyDefaultValue -Name 'From')
Accept pipeline input: False
Accept wildcard characters: FalseThe currencies to convert to.
Type: String[]
Parameter Sets: (All)
Aliases:
Required: True
Position: 2
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseOptional: To use the v6 API, provide your API key, as provided by https://www.exchangerate-api.com/ Defaults to the value saved with Set-CurrencyDefault -APIKey, if any.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: (Get-CurrencyDefaultValue -Name 'APIKey')
Accept pipeline input: False
Accept wildcard characters: FalseOptional: Converts using the historical exchange rates for the specified date, instead of the latest rates. This requires an -APIKey, as historical data is only available via the registered v6 API. Historical results are cached indefinitely once retrieved, as they do not change.
Type: DateTime
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False{{Fill ProgressAction Description}}
Type: ActionPreference
Parameter Sets: (All)
Aliases: proga
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseThis cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).
https://github.com/markwragg/PowerShell-CurrencyConverter/wiki/ConvertTo-CurrencyTable