Skip to content

Instantly share code, notes, and snippets.

@nyanhp
Last active May 11, 2021 15:52
Show Gist options
  • Save nyanhp/f99663b4e3a01ac23a84a3b7892f162d to your computer and use it in GitHub Desktop.
Save nyanhp/f99663b4e3a01ac23a84a3b7892f162d to your computer and use it in GitHub Desktop.
Using AutomatedLab recipes
Install-Module AutomatedLab.Recipe -AllowClobber -Force
# Inline definition and execution
LabRecipe MySuperLab {
DeployRole = 'Domain', 'SQL'
VmPrefix = 'LB'
} | Invoke-LabRecipe
# Store a lab for later use
New-LabRecipe -Name MySuperLab -DeployRole DscPull,CI_CD
# List recipes
Get-LabRecipe
Get-LabRecipe -Name MySuperLab
# WHen Invoking, you can specify optional parameters
Invoke-LabRecipe -Name MySuperLab -DefaultAddressSpace 192.168.11.0/24
# To just grab the script and modify it, use NoDeploy and PassThru or outFile
$scriptblock = Invoke-LabRecipe -Name MySuperLab -DefaultAddressSpace 192.168.11.0/24 -NoDeploy -PassThru -OutFile .\MySuperLab.ps1
& $scriptblock
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment