Skip to content

TFokyoDrift

TFokyoDrift is a PowerShell module that contains functions for interacting with and analyzing Terraform changes and drifts.

Download the latest release or clone the git repository and run the build script to create the module, then import it into your session and try out the example commands contained in the Tests folder.

Requirements

  • PowerShell 7 or later
  • PowerShell Modules (see Building the module for automatic installation):
  • BuildHelpers
  • ModuleBuilder
  • Pester
  • PlatyPS
  • PSScriptAnalyzer

Building the module

Run the build script from the repository root. This will install dependencies (if needed), run PSScriptAnalyzer, execute Pester tests, and build the module.

# Standard build (Test + Build + Increment Patch Version)
./build.ps1

# Install dependencies first
./build.ps1 -Bootstrap

# Build without running tests
./build.ps1 -Task Build

# Increment Minor version
./build.ps1 -Increment Minor

# Skip version increment
./build.ps1 -Increment None

Installing the module

After the build completes, import the newly built module using the included helper script or Import-Module directly:

# Import the most recent build
./ImportModule.ps1

# Optionally remove previous builds
./ImportModule.ps1 -Clean

# Or import by path
Import-Module ./Output/TFokyoDrift/*/TFokyoDrift.psd1

Running the tests

The Tests/Tests.ps1 file contains snippets demonstrating how to use the module with the sample JSON test data provided in the Tests folder. After importing the module, open the file and execute the commands you are interested in. For example:

pwsh
# from repository root
./ImportModule.ps1
. ./Tests/Tests.ps1

The comments in Tests/Tests.ps1 describe what each block is expected to produce.