Git Product home page Git Product logo

ionmodule's Introduction

What is this?

This is the code for a PowerShell module for TD Synnex ION. It is a work in progress and it does have a generic 'Invoke-TDRestMethod' available so you can make any API call you want. See advanced usage examples below.

The module is written for PowerShell 7.

More info on the API can be found HERE

What does it do?

IONModule provides a PowerShell wrapper around the ION API. The module handles all the authentication for you. All you need to do is supply your ION API Refresh Token using the 'Set-APIDetails' command.

You can get a Refresh Token by going into the user accounts section in the ION portal. Click into a user and under "OAth Credentials" you can request a refresh token. Refresh Tokens have a one time usage limit. You can read more on that HERE

Installing

This module is published to the PowerShell Gallery and can be installed from within PowerShell with Install-Module

Install-Module -Name IONModule

Updating

This module is updated regularly. Remember to always check for the latest version from within PowerShell with Update-Module

Update-Module -Name IONModule

Getting Started

Whilst this module can be used without an Azure Keyvault, you would need a new refresh token every 2 hours which is a manual process of going to the ION portal, and getting a new refresh token. This is because ION have made their refresh tokens single use. Instead I recommend you setup an Azure Keyvault, store your initial refresh token in the keyvault, and use the "Advanced" connection method mentioned HERE

Otherwise if you are going to manually enter your refresh token, please see below

Connecting the PowerShell module to the API using a manually entered refresh token.

  1. Set API Connection details
Set-APIDetails -Refreshtoken "YourRefreshTokenGoesHere" -AccountID "Your Account ID goes here"
  1. Test your first call to the API
Get-AccessTokenExpiry

If the above returns something similar to the below, then you are connected to the API

access_expires_in refresh_expires_in
----------------- ------------------
             7199            2764774

Connecting the PowerShell module with your refresh token being stored in an Azure Keyvault.

  1. Set KeyVault Details
Set-KeyVaultDetails -AzureSubscriptionId "31df7912-4fc7-4ce7-b7a8-2cece6fbe51d" -KeyVaultName "YourKeyVaultName" -KeyVaultSecretName "YourKeyVaultSecretName" -AccountID "Your ION Account ID"
  1. Test your first call to the API
Get-AccessTokenExpiry

If the above returns something similar to the below, then you are connected to the API

access_expires_in refresh_expires_in
----------------- ------------------
             7199            2764774

Cmdlet Help

Access-Authentication

Catalog

Customer

Order

Provisioning-Template

Subscription

Invoke-TDRestMethod

Set-APIDetails

Set-KeyVaultDetails

Future Releases

  • Add Azure Keyvault functionality Complete
  • Add additional endpoints

ionmodule's People

Contributors

bnwein avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.