To test resources deployed using the ARM template, it is important that the template deployment generates the necessary outputs that can be read later for testing purposes. Since this activity has already been taken care of, it's time to read the outputs. The outputs from the ARM template can be read using Get-AzureRmResouceGroupDeployment and passing the name of the deployment, along with the resource group's name. The returned output from this cmdlet can be used to retrieve the outputs individually. This code should be placed within the BeforeAll function of Pester so that it can be executed before any of the test cases are executed.
The code shown next gets all the outputs for each resource and stores them into individual variables. Notice the name used to get the values. It is the same as that used in the output section of the ARM template...