Repository navigation
Convert CryptoCurrency
Converts a decimal value between specified crypto and/or non-crypto currencies
Convert-CryptoCurrency [-Value] <Decimal> [-From <String>] [-To <String>] [-CacheSeconds <Object>]
[-ProgressAction <ActionPreference>] [<CommonParameters>]
Uses the Coin Base API (https://api.coinbase.com/v2/exchange-rates) to perform currency conversions. Caches the conversion rates for the specified currency for a number of seconds if -CacheSeconds is specified.
100 | Convert-CryptoCurrency -From BTC -To ETH
Converts the value 100 (provided via the pipeline) from BTC (Bitcount) to ETH (Ether), example result: 2149.6130696474600
Convert-CryptoCurrency -Value 100 -From ETH -To GBP
Converts the value 100 from ETH (Ether) to GBP (British Pound), example result: 245122.500
Convert-CryptoCurrency -Value 1 -From BTC -To ETH | Format-Currency
Converts 1 BTC to ETH and pipes the result to Format-Currency, which picks up the destination currency (ETH) from the pipeline, example result: Ξ21.4961307
Set-CurrencyDefault -From BTC -To ETH
Convert-CryptoCurrency -Value 1
Saves BTC/ETH as the default currencies to convert between, then converts 1 BTC to ETH without needing to specify -From/-To.
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 currency to convert to. Defaults to the value saved with Set-CurrencyDefault -To, if any.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: (Get-CurrencyDefaultValue -Name 'To')
Accept pipeline input: False
Accept wildcard characters: FalseNumber of seconds to cache the result. Default: 0.
Type: Object
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: 0
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/Convert-CryptoCurrency