Share via

Pester Tests

Sara 441 Reputation points
2021-04-28T12:03:13.707+00:00

Can someone help me with writing a pester test on checking if multiple services are running on multiple servers and to pull the local users group and admin group and it it returns empty it should fail.

Kind of able to put one for one service and one server , but want to make it work for multiple service and multiple server?

describe 'PC Tests' {

$servername = ' '
$status = (get-service -computername $servername -Name 'service' ).status

it 'should be running' {
$status | should be 'Running'

}

}

Windows for business | Windows Server | User experience | PowerShell
0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.