Skip to main content

1E SDK

Installing the 1E PowerShell Toolkit

Installing to the default module folder location

First, download and extract the zip.

Then, to install to the default module folder, copy the Toolkit files to the appropriate default PowerShell modules folder location. This will make the Toolkit modules available to either the current user, or all users on the install device, depending on the path you chose.

To see the appropriate folder locations, examine the $Env:PSModulePath variable in PowerShell.

  • First location is the per-user module folder

  • Second location is the per-machine install folder. This is typically: C:\Program Files\WindowsPowerShell\Modules

Assuming you are installing to the per-machine folder, create a new folder under this path called PS1EToolkit and copy the following files into this folder.

  • PS1EToolkit.psd1

  • ps1Etoolkit.psm1

  • methods.json

  • 1E.InstructionSigner.exe

  • 1E.InstructionSigner.exe.config

You can now import the Toolkit into a PowerShell session by typing:

import-module PS1EToolkit

Note

You do not need to copy the supplied Instructions XML files because they are intended to be uploaded to 1E to provide support for OSQuery integration and Querying Tachyon Activity Records using the Tachyon PowerShell Toolkit. Uploading these, only has to be done once.

Installing to the current folder

You can alternatively choose to run the PowerShell Toolkit from any folder you choose. To do this, ensure that the files from the above location are in an appropriate folder and launch a PowerShell command prompt, from an account that has the appropriate 1E privileges.

Import the manifest with:

import-module .\ps1EToolkit

Note

You can use the optional -Force parameter to import-module to ensure that the module is always imported, even if already present. This may be useful if you have an older version of the Toolkit already installed to the default module folder location but want to override with a later version which is in a specific folder.

You can use the get-1EToolkitversion to determine the currently active version of the Toolkit at any time.

Setting the 1E Server

Before you can use the PowerShell Toolkit, you must define the server to which it will connect.

Set the server you want to communicate with:

set-1Eserver <server name>

For example, if the server is 'tachyon.urth.local'

set-1Eserver tachyon.urth.local

Note

If you fail to set the server, any command you subsequently invoke will throw an exception and indicate that you need to set this first.

The above PowerShell command also confirms that the server responds appropriately when set. If you specify an invalid server address, or the server is not responding correctly, an error will be thrown.

Alternate credentials

If you wish to connect to the server using alternate credentials (i.e, not in the context of your current user account) then you can use the optional-Credentialparameter to set-1Eserver. To be prompted for these credentials, use the standard PowerShell get-credential cmdlet. For example:-Credential (get-credential)

Script customization

To customize the pstachyonToolkit.psm1 script, simply change the variables at the top of the script to reflect the environment in which you are working. The current set of customizable variables are shown below.

$TACHYONCONSUMER = "Explorer" # Consumer to use when executing instructions
$INSTPREFIX = "1E-Exchange" # Instruction prefix that you have a license for and corresponding code signing certificate in your local machine cert store
$INSTRUCTIONSET = "DynamicScripting" # Instruction set name where dynamic instructions are created in Tachyon
$MAXTARGETDEVICES = 10 # Maximum number of devices allowed to be targeted by scope; this is a safety-catch to prevent you accidentally sending stuff out to a large device count

Note

If you make changes to this script, you should reload the module using the -force option to ensure that the cached module code is correctly replaced in your PowerShell command instance, as follows:

import-module .\pstachyonToolkit.psd1 -force