зеркало из https://github.com/Azure/benchpress.git
1.4 KiB
1.4 KiB
How To Run OperationalInsightsWorkspace.Tests.ps1
OperationalInsightsWorkspace.Tests.ps1
contains examples of using the Confirm-AzBPOperationalInsightsWorkspace
cmdlet.
Pre-Requisites
- Follow the setup instructions
Steps
-
Navigate to OperationalInsightsWorkspace directory:
cd examples/OperationalInsightsWorkspace/
-
Deploy the Operational Insights Workspace to your subscription:
New-AzResourceGroupDeployment -TemplateFile "./operationalInsightsWorkspace.bicep" ` -Location "WestUS3"
-
Update
OperationalInsightsWorkspace.Tests.ps1
variables to point to your expected resources:rg-test
->your-resource-group-name
oiwName
->your-operational-insights-workspace-name
westus3
->your-operational-insights-location
-
If using a local copy of
BenchPress.Azure
, replaceImport-Module BenchPress.Azure
withImport-Module "../../bin/BenchPress.Azure.psd1"
. Note that the finalAfterAll
step will properly remove the module regardless of which method is chosen to load the module. -
Run
OperationalInsightsWorkspace.Tests.ps1
:Invoke-Pester -Path ./OperationalInsightsWorkspace.Tests.ps1
-
Success!
Tests completed in 952ms Tests Passed: 2, Failed: 0, Skipped: 0 NotRun: 0
-
Don't forget to delete any deployed resources that are no longer needed.