Skip to content

Commit 149f307

Browse files
committed
Add CI workflow and basic tests
1 parent e4f9473 commit 149f307

2 files changed

Lines changed: 40 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
jobs:
8+
test:
9+
runs-on: windows-latest
10+
steps:
11+
- uses: actions/checkout@v4
12+
13+
- name: Install Pester + PSScriptAnalyzer
14+
shell: pwsh
15+
run: |
16+
Set-PSRepository -Name PSGallery -InstallationPolicy Trusted
17+
Install-Module Pester -Force -Scope CurrentUser
18+
Install-Module PSScriptAnalyzer -Force -Scope CurrentUser
19+
20+
- name: PSScriptAnalyzer
21+
shell: pwsh
22+
run: |
23+
Invoke-ScriptAnalyzer -Path . -Recurse -Severity Warning,Error
24+
25+
- name: Pester Tests
26+
shell: pwsh
27+
run: |
28+
Invoke-Pester -Path .\Tests -Output Detailed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
$ErrorActionPreference = 'Stop'
2+
3+
Describe "ExchangeOOO-BulkSetter" {
4+
It "script file exists" {
5+
Test-Path "$PSScriptRoot\..\Set-BulkMailboxAutoReply.ps1" | Should -BeTrue
6+
}
7+
8+
It "has CmdletBinding" {
9+
$content = Get-Content "$PSScriptRoot\..\Set-BulkMailboxAutoReply.ps1" -Raw
10+
$content | Should -Match '\[CmdletBinding'
11+
}
12+
}

0 commit comments

Comments
 (0)