-
Notifications
You must be signed in to change notification settings - Fork 14
58 lines (47 loc) · 1.83 KB
/
test_install_pwsh_installer.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
name: Test PowerShell Installer
on:
workflow_dispatch:
push:
paths:
- '**.ps1'
jobs:
pwsh_install_script:
name: Run PowerShell install script
runs-on: windows-2022
steps:
- name: Check out repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Test download.ps1 PowerShell script
shell: powershell
run: |
./download.ps1
./cnspec version
Remove-Item ./cnspec.exe
- name: Install mondoo package
shell: powershell
env:
MONDOO_TOKEN: ${{ secrets.MONDOO_TOKEN }}
run: |
Write-Output "Download and install the mondoo MSI package"
Import-Module ./install.ps1
Install-Mondoo -RegistrationToken $env:MONDOO_TOKEN -Service enable -UpdateTask enable -Time 12:00 -Interval 3; cnspec status
Write-Output "Check if mondoo is installed"
& 'C:\Program Files\Mondoo\cnspec.exe' version
Write-Output "Check if mondoo config exists"
Test-Path C:\ProgramData\Mondoo\mondoo.yml
Write-Output "Check if mondoo service is running"
$result=(cnspec run local -c "service('mondoo').running" --json | ConvertFrom-Json)
$result."service.running" -eq 'True'
Write-Output "Unregister from mondoo"
& 'C:\Program Files\Mondoo\cnspec.exe' logout --force
- name: Test scan.ps1 PowerShell script
shell: powershell
env:
MONDOO_TOKEN: ${{ secrets.MONDOO_TOKEN }}
run: |
Write-Output "Donwload cnspec client"
./download.ps1 -Path 'C:\Users\Public'
Write-Output "execute scan.ps1"
.\mdm-scripts\windows\scan.ps1 -DownloadPath '\\localhost\C$\Users\Public' -ExecutionPath 'C:\Users' -RegistrationToken $env:MONDOO_TOKEN