Repository navigation
Get ExchangeRate
Returns all exchange rates for a specified currency, or a specified exchange rate between two currencies.
Get-ExchangeRate [[-Currency] <String>] [-To <String>] [-APIKey <String>] [-Date <DateTime>]
[-ProgressAction <ActionPreference>] [<CommonParameters>]
Get-ExchangeRate [[-Currency] <String>] [-Rates] [-APIKey <String>] [-Date <DateTime>]
[-ProgressAction <ActionPreference>] [<CommonParameters>]
Uses the Open Exchange Rate API (https://www.exchangerate-api.com/docs/free) to retrieve currency rates. Caches the conversion rates for the specified currency (valid for 24 hours).
Get-ExchangeRate -Currency USD
Returns the exchange rates for US Dollar as a PowerShell object.
Get-ExchangeRate -From USD -To GBP -Date '2024-01-15' -ApiKey yourapikeystringhere
Returns the exchange rate from US Dollar to British Pound as it was on 15th January 2024.
Get-ExchangeRate -Currency USD -Rates
Returns all exchange rates for US Dollar.
Get-ExchangeRate -From USD -To GBP
Returns the exchange rate from US Dollar to British Pound, example result: 0.792011
'USD','GBP' | Get-ExchangeRate
Returns the exchange rates for US Dollar and British Pound as PowerShell objects.
Set-CurrencyDefault -From USD -To GBP
Get-ExchangeRate
Saves USD/GBP as the default currencies, then returns the exchange rate from US Dollar to British Pound without needing to specify -Currency/-To.
The currency to return exchange rates for. (Alias: From) Defaults to the value saved with Set-CurrencyDefault -From, if any.
Type: String
Parameter Sets: (All)
Aliases: From
Required: False
Position: 1
Default value: (Get-CurrencyDefaultValue -Name 'From')
Accept pipeline input: True (ByPropertyName, ByValue)
Accept wildcard characters: FalseThe currency to return the exchange rate to (from the currency specified as -Currency or -From). Defaults to the value saved with Set-CurrencyDefault -To, if any.
Type: String
Parameter Sets: ToRate
Aliases:
Required: False
Position: Named
Default value: (Get-CurrencyDefaultValue -Name 'To')
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: FalseSwitch: Use to return just the exchange rates for a specified currency.
Type: SwitchParameter
Parameter Sets: Rates
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: True (ByPropertyName)
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: Returns 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/Get-ExchangeRate