< Back

Test-LabDeployment

Sat Jan 11, 2020 2:10 am

NAME Test-LabDeployment



SYNOPSIS

Test a lab deployment





SYNTAX

Test-LabDeployment [-All] [-Filter <String>] [-LogDirectory <String>] [-Replace <Hashtable>] [-SampleScriptsPath

<String>] [<CommonParameters>]



Test-LabDeployment [-LogDirectory <String>] [-Path <String[]>] [-Replace <Hashtable>] [<CommonParameters>]





DESCRIPTION

Test a lab deployment. Optionally replace values in the scripts like image versions or Azure resource group names.





PARAMETERS

-All [<SwitchParameter>]

Test all scripts in a folder



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-Filter <String>

Filter scripts



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-LogDirectory <String>

Log folder for test results



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-Path <String[]>

Path to the lab script(s)



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-Replace <Hashtable>

Replace hashtable keys with hashtable values in each script



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-SampleScriptsPath <String>

Path to the sample scripts



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS

None







OUTPUTS

System.Object







NOTES









-------------------------- Example 1 --------------------------



$result = Test-LabDeployment -Path "$labSources\\Sample Scripts\\Workshop Labs\\PowerShell Lab - Azure.ps1" -Replace

@{

'<SOME UNIQUE DATA>' = "somelab$(Get-Random)"

"(\\`$azureDefaultLocation = ')(\\w| )+(')" = '$1North Europe$3'

'(Add-LabAzureSubscription -DefaultLocationName \\$azureDefaultLocation)' = '$1 -SubscriptionName AL'

}



Test an Azure based lab, replacing the place holders with your own subscription data

-------------------------- Example 2 --------------------------



$result = Test-LabDeployment -Path "$labSources\\Sample Scripts\\HyperV\\Single 2012R2 Server.ps1"



Test a single script

-------------------------- Example 3 --------------------------



$result = Test-LabDeployment -SampleScriptsPath "$labSources\\Sample Scripts\\HyperV" -All



Test all scripts in the HyperV folder



RELATED LINKS