microsoft/hve-core

Public

mirrored fromhttps://github.com/microsoft/hve-coreAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
0bce418ef9a17e5e311d7cc01dc4e8ac699aa51f

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

scripts/README.md

86lines · modecode

1---
2title: Scripts
3description: PowerShell scripts for linting, validation, and security automation
4author: HVE Core Team
5ms.date: 2025-11-05
6ms.topic: reference
7keywords:
8 - powershell
9 - scripts
10 - automation
11 - linting
12 - security
13estimated_reading_time: 5
14---
15
16This directory contains PowerShell scripts for automating linting, validation, and security checks in the `hve-core` repository.
17
18## Directory Structure
19
20```text
21scripts/
22├── linting/ PowerShell linting and validation scripts
23└── security/ Security scanning and SHA pinning scripts
24```
25
26## Linting Scripts
27
28The `linting/` directory contains scripts for validating code quality and documentation:
29
30* **PSScriptAnalyzer**: Static analysis for PowerShell files
31* **Markdown Frontmatter**: Validate YAML frontmatter in markdown files
32* **Link Language Check**: Detect en-us language paths in URLs
33* **Markdown Link Check**: Validate markdown links
34* **Shared Module**: Common helper functions for GitHub Actions integration
35
36See [linting/README.md](linting/README.md) for detailed documentation.
37
38## Security Scripts
39
40The `security/` directory contains scripts for security scanning and dependency management:
41
42* **Dependency Pinning**: Validate SHA pinning compliance
43* **SHA Staleness**: Check for outdated SHA pins
44* **SHA Updates**: Automate updating GitHub Actions SHA pins
45
46## Usage
47
48All scripts are designed to run both locally and in GitHub Actions workflows. They support common parameters like `-Verbose` and `-Debug` for troubleshooting.
49
50**Local Testing**:
51
52```powershell
53# Test PSScriptAnalyzer on changed files
54./scripts/linting/Invoke-PSScriptAnalyzer.ps1 -ChangedFilesOnly -Verbose
55
56# Validate markdown frontmatter
57./scripts/linting/Validate-MarkdownFrontmatter.ps1 -Verbose
58
59# Check for language paths in URLs
60./scripts/linting/Invoke-LinkLanguageCheck.ps1 -Verbose
61```
62
63**GitHub Actions Integration**:
64
65All scripts automatically detect GitHub Actions environment and provide appropriate output formatting (annotations, summaries, artifacts).
66
67## Contributing
68
69When adding new scripts:
70
711. Follow PowerShell best practices (PSScriptAnalyzer compliant)
722. Support `-Verbose` and `-Debug` parameters
733. Add GitHub Actions integration using `LintingHelpers` module functions
744. Include inline help with `.SYNOPSIS`, `.DESCRIPTION`, `.PARAMETER`, and `.EXAMPLE`
755. Document in relevant README files
766. Test locally before creating PR
77
78## Related Documentation
79
80* [Linting Scripts Documentation](linting/README.md)
81* [GitHub Workflows Documentation](../.github/workflows/README.md)
82* [Contributing Guidelines](../CONTRIBUTING.md)
83
84---
85
86🤖 Crafted with precision by ✨Copilot following brilliant human instruction, then carefully refined by our team of discerning human reviewers.
87