Skip to content

petrsx/pester-network-watcher

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pester-network-watcher

Test PowerShell on Ubuntu

Prerequisities

Powershell Modules

If you running the test locally, install folowing modules

Az.Resources is required only for deployment, not for the test itself.

Install-Module Az.Accounts, Az.Resources, Az.Compute, Az.Network, Pester

Azure Lab

Login into your Azure environment

Connect-AzAccount -TenantId <your tenantId> -UseDeviceAuthentication

Change context to your Subscription

Set-AzContext -Subscription gabcf-dev-001

You can deploy one of the example from Microsoft azure-hub-spoke

For Azure CLI deploymnet see the example README.md

$resourceGroup = New-AzResourceGroup -Name "rg-hub-spoke-dev-001" -Location "westeurope"
New-AzResourceGroupDeployment `
    -ResourceGroupName $resourceGroup.ResourceGroupName `
    -TemplateUri "https://raw.githubusercontent.com/mspnp/samples/main/solutions/azure-hub-spoke/azuredeploy.json" `
    -deployVirtualMachines $true `
    -adminUsername "azureadmin" `
    -adminPassword (ConvertTo-SecureString -String "Password2023!" -AsPlainText -Force)

After deployment succeed you should see multiple Azure Resources in your Resource Group

resources

Pester Test

https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-powershell

About

Azure Network Watcher tests demo

Topics

Resources

Stars

Watchers

Forks