Up Bank PowerShell Module

Updated: 31 Aug 2020
v1.0.1 released with new cmdlets for new API's
to both GitHub and the PowerShell Gallery.
- Get-UpBankCategories
- Get-UpBankCategory
- Get-UpBankTags

Banking is undergoing a revolution. In Australia the rise of Neo Banks is really starting to get momentum and one of the first entrants was Up. With a target demographic of Digital Natives, initially the services offered were foundational. But as a customer over the last 18 months, I’ve personally seen the functionality increase with fantastic cadence. To much acclaim they’ve also been very transparent with their feature road map as shown here. This week they announced the first release of their customer API. As a happy customer that prompted me to publish the first release of my Up Bank PowerShell Module. The Up Bank PowerShell Module joins others I’ve recently published.

Up Bank PowerShell Module

My Up Bank PowerShell Module is open source with the source available on GitHub here. This first release provides the core functionality matches with the initial release of the Up Bank customer API.

Installation

The Up Bank PowerShell Module can be installed from the PowerShell Gallery on Windows PowerShell 5.1+, PowerShell Core 6.x or PowerShell. The module is therefore supported cross platform (Mac, Windows, Linux).

Install-Module -name UpBank

Module Cmdlets

The module currently contains 9 cmdlets;

  • Set-UpBankCredential
    • Sets the default Up Bank API credentials used to authenticate to the Up Bank API
  • Save-UpBankConfiguration
    • Saves default Up Bank configuration to a file in the current users Profile.
      • If this configuration file exists when the module is loaded the default profile is loaded automatically allowing profile settings to persist between sessions.
        • Note: PersonalAccessTokens are encrypted and the configuration file can not be used outside of the users profile that created the configuration.
  • Switch-UpBankProfile
    • Changes the Up Bank Account Credentials used to a different Up Bank Profile.
  • Test-UpBankAPI
    • Test the credentials configured are valid and the API can be accessed.
  • Get-UpBankAccounts
    • List Up Bank Accounts.
  • Get-UpBankAccount
    • Get a specific Up Bank Account
  • Get-UpBankTransactions
    • Retrieve a list of all transactions across all accounts for the currently authenticated user.
  • Get-UpBankTransaction
    • Retrieve a specific Up Bank Transaction.
  • Get-UpBankAccountTransactions
    • Retrieve a list of all transactions for a specific account for the currently authenticated user.

Getting Started

Set Up Bank Credentials

The module supports multiple sets of credentials. One set can be set as default (see Save-UpBankCredential) and will be automatically and securely loaded when the module loads. This avoids having to set the credentials every-time.

Set-UpBankCredential needs to be passed a PowerShell Credential object. This can be generated using Get-Credential. The value provided for User (when using get-credential) is used as the profile name. Generate your Personal Access Token here.

$myUpBankCredentials = Get-Credential
Set-UpBankCredential -credential $myUpBankCredentials

Save Up Bank Configuration

Securely save credentials for an Up Bank user to the configuration file.

The optional default switch means this profile will be automatically loaded next time the Up Bank PowerShell Module is loaded. Use Switch-UpBankProfile to switch to another Profile.

Save-UpBankConfiguration -default

Switch Up Bank Configuration Profiles

The Up Bank PowerShell Module allows multiple account profiles to be configured.

When using Set-UpBankCredential the value provided for User (when using get-credential) is used as the profile name. The Switch-UpBankProfile cmdlet can be used to switch profiles.

Switch-UpBankProfile -profile Darren

Switch Up Bank Configuration Profiles and make the profile switched to the new default

Below is an example to switch the current configuration to a profile named Kate and make it the new default profile. The Kate profile will then be loaded automatically the next time the module is loaded.

Switch-UpBankProfile -profile Kate -default

Inspect the Up Bank Configuration Settings

The following command can be used to see what profiles are stored in the Up Bank Configuration file.

Note: The PersonalAccessTokens are encrypted and the configuration file can not be used outside of the users profile that created the configuration.

$configFile = Join-Path $env:LOCALAPPDATA UpBankConfiguration.clixml
import-clixml $configFile

Test Up Bank API Connectivity

The Test-UpBankAPI cmdlet is used to test to see if the currently loaded credentials are valid.

Test-UpBankAPI

Get Up Bank Accounts

List Up Bank Accounts

Query and return all Up Bank Accounts.

$myAccounts = Get-UpBankAccounts 
Write-Host -ForegroundColor Green "$($myAccounts.count) account(s) found."
foreach ($account in $myAccounts) {
   Write-Host -ForegroundColor Blue " $($account.attributes.displayName)"
}

Get an Up Bank Account

Query and return the details for a specific Up Bank Account

Get-UpBankAccount -id $myAccounts[0].id

Get Transactions across all accounts

Return the most recent transactions (defaults to 100) across all accounts.

Get-UpBankTransactions

Query and return the most recent 200 transactions across all accounts.

Get-UpBankTransactions -pageSize 200

Get Transactions Since a date and time across all accounts

Get the last transactions (defaults to max 100) since 27 July 2020 09:07:54 Australian Eastern Time.

Get-UpBankTransactions -since 2020-07-27T09:07:54+10:00

Get the last 10 transactions since 27 July 2020 09:07:54 Australian Eastern Time.

Get-UpBankTransactions -pageSize 10 -since 2020-07-27T09:07:54+10:00

Get the last Up Bank Account Transaction across all accounts

(Get-UpBankTransactions -pageSize 1).attributes

Get Transactions for a specific account

Query the most recent transaction(s) (defaults to max 100) on a specific account.

$myAccounts = Get-UpBankAccounts 
Get-UpBankAccountTransactions -accountID $myAccounts[0].id

Query and return the most recent 201 transactions on an account.

$myAccounts = Get-UpBankAccounts 
Get-UpBankAccountTransactions -accountID $myAccounts[0].id -pageSize 201

Get the last 10 Transactions since a date and time for a specific account

Return the last 10 transactions since 27 May 2020 09:07:54 Australian Eastern Time from a specific account.

Get-UpBankAccountTransactions -accountID $myAccounts[1].id -since 2020-05-27T09:07:54+10:00 -pageSize 10

Get the Transactions up to a date and time for a specific account (defaults to 100)

Return the last (defaults to 100) transactions since 27 July 2020 01:02:03 Australian Eastern Time from a specific account.

Get-UpBankAccountTransactions -accountID $myAccounts[1].id -until 2020-07-27T01:02:03+10:00

How can I contribute to the project?

  • Found an issue and want us to fix it? Log it here
  • Want to fix an issue yourself or add functionality? Clone the project and submit a pull request.
  • Any and all contributions are more than welcome and appreciated.