Skip to content

Commit

Permalink
Refactor GitHub Actions workflow for PowerShell script validation and…
Browse files Browse the repository at this point in the history
… update TODO comment in myvms.ps1
  • Loading branch information
erikhje committed Feb 22, 2026
1 parent 333443c commit fb851b3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 22 deletions.
30 changes: 9 additions & 21 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,18 @@
# .github/workflows/validate.yml
name: Validate PowerShell Scripts
name: PSScriptAnalyzer

on:
push:
paths:
- "scripts/**/*.ps1"
- ".github/workflows/validate.yml"
pull_request:
paths:
- "scripts/**/*.ps1"
- ".github/workflows/validate.yml"

jobs:
validate:
runs-on: ubuntu-latest
analyze:
runs-on: ubuntu-latest # required host runner
container:
image: gossin/secsrv-cicd:2112 # your full environment is here

steps:
- name: Checkout
- name: Checkout repo # needed so the container sees your scripts
uses: actions/checkout@v4

- name: Install PSScriptAnalyzer
shell: pwsh
run: |
Set-PSRepository -Name 'PSGallery' -InstallationPolicy Trusted
Install-Module PSScriptAnalyzer -Scope CurrentUser -Force -SkipPublisherCheck
- name: Run ScriptAnalyzer
shell: pwsh
run: |
Invoke-ScriptAnalyzer -EnableExit scripts/*.ps1
- name: Run ScriptAnalyzer on all PowerShell files
run: pwsh -Command "Invoke-ScriptAnalyzer -Path . -Recurse -EnableExit"
2 changes: 1 addition & 1 deletion scripts/myvms.ps1
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
param($logintype = $(throw "Parameter logintype is required"))

# Usage: myvms.ps1 [mgr|cl1|dc1|srv1|mgra|cl1a|dc1a|srv1a]
# TODO: fix til full script syntaks ala oblig 1
# TODO: fix til full script syntaks som oblig 1

# floating ip's and the Admin-user-password for each host (retrieve from SkyHiGh):
$mgr_ip =''
Expand Down

0 comments on commit fb851b3

Please sign in to comment.