This repository comprises a static dummy API for use with the Data Store demo functions from the Mocking chapter of Modern IT Automation with PowerShell, 1st edition.
There are eight subdirectories, 001–008, each representing a bucket of data that serves as the remote $Source
for Update-DataStore
.
Each bucket has an updates manifest in the root.
This file contains information about the dummy data in the data subdirectory of the bucket.
Each file in data is an 'update' to the bucket and Update-DataStore
should select and synchronize the latest of these.
The files contain randomly generated dummy data from New-DummyAPIData.ps1.
Pass the GitHub raw URL for the numbered subdirectory to the -Source
parameter of Update-DataStore
:
New-DataStore -Name Test01
Set-DataStoreDate -Name Test01 -Update '2000-01-01'
$Uri = 'https://raw.githubusercontent.com/TheFreeman193/mita-dummyapi/main/001'
Update-DataStore -Name Test01 -Source $Uri
The Update-DataStore
function appends updates to the $Source
path to retrieve the update manifest, and data/<timestamp> to retrieve a bucket update.
Where for a real API this might represent queries, the dummy API provides raw files at fixed paths.
You can find the data store demo functions, along with Pester test files used in the chapter, in the Modern IT Automation with PowerShell Extras repository.
They are duplicated here in the DataStoreDemo subdirectory.
The content of this repository is released under the MIT License. Please also attribute DevOps Collective, Inc., the publisher of the book.