Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
# Needed for publishing of examples, build worker defaults to core.autocrlf=input.
* text eol=crlf

# PowerShell files should use LF (cross-platform standard)
*.ps1 text eol=lf
*.psm1 text eol=lf
*.psd1 text eol=lf

# Common PS ancillary files
*.ps1xml text eol=lf
*.pssc text eol=lf
*.psrc text eol=lf

# YAML files should use LF (YAML standard)
*.yml text eol=lf
*.yaml text eol=lf
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ BeforeDiscovery {
}
catch [System.IO.FileNotFoundException]
{
throw 'DscResource.Test module dependency not found. Please run ".\build.ps1 -ResolveDependency -Tasks build" first.'
throw 'DscResource.Test module dependency not found. Please run ".\build.ps1 -ResolveDependency -Tasks noop" first.'
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
description: Guidelines for writing PowerShell scripts and modules.
applyTo: "**/*.ps?(m|d)1"
applyTo: "{**/*.ps1,**/*.psm1,**/*.psd1}"
---

# PowerShell Guidelines
Expand Down Expand Up @@ -222,7 +222,7 @@ function Get-Something
## File Rules

- End files with only one blank line
- Use CR+LF line endings
- Use line endings based on .gitattributes policy
- Maximum two consecutive newlines
- No line shall have trailing whitespace

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
description: Guidelines for writing and maintaining unit tests using Pester.
applyTo: "tests/[u]Unit/**/*.[Tt]ests.ps1"
applyTo: "tests/[Uu]nit/**/*.[Tt]ests.ps1"
---

# Unit Tests Guidelines
Expand Down Expand Up @@ -36,7 +36,7 @@ BeforeDiscovery {
}
catch [System.IO.FileNotFoundException]
{
throw 'DscResource.Test module dependency not found. Please run ".\build.ps1 -ResolveDependency -Tasks build" first.'
throw 'DscResource.Test module dependency not found. Please run ".\build.ps1 -ResolveDependency -Tasks noop" first.'
}
}

Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/copilot-setup-steps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ jobs:
- name: Set Environment Variables
shell: bash
run: |
echo "MODULE_NAME=SqlServerDsc" >> "$GITHUB_ENV"
echo "Setting MODULE_NAME=$MODULE_NAME to GitHub environment"
echo "MODULE_NAME=$MODULE_NAME" >> "$GITHUB_ENV"

- name: Checkout Repository
uses: actions/checkout@v5
Expand Down
84 changes: 60 additions & 24 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@
"linux": {
"options": {
"shell": {
"executable": "/usr/bin/pwsh",
"executable": "/usr/bin/env",
"args": [
"pwsh",
"-NoProfile",
"-Command"
]
Expand All @@ -28,8 +29,9 @@
"osx": {
"options": {
"shell": {
"executable": "/usr/local/bin/pwsh",
"executable": "/usr/bin/env",
"args": [
"pwsh",
"-NoProfile",
"-Command"
]
Expand All @@ -40,8 +42,11 @@
{
"label": "build",
"type": "shell",
"command": "&${cwd}/build.ps1",
"args": ["-AutoRestore", "-UseModuleFast", "-Tasks", "build"],
"command": "./build.ps1 -AutoRestore -Tasks build -UseModuleFast",
"group": {
"kind": "build",
"isDefault": true
},
"presentation": {
"echo": true,
"reveal": "always",
Expand Down Expand Up @@ -83,17 +88,55 @@
{
"label": "test",
"type": "shell",
"command": "&${cwd}/build.ps1",
"args": [
"-AutoRestore",
"-UseModuleFast",
"-Tasks",
"test",
"-PesterPath",
"./tests/Unit/Classes,./tests/Unit/Private,./tests/Unit/Public,./tests/QA",
"-CodeCoverageThreshold",
"0"
],
"command": "./build.ps1 -Tasks noop;Invoke-PesterJob -Path './tests/Unit/Classes','./tests/Unit/Private','./tests/Unit/Public','./tests/QA' -SkipCodeCoverage",
"group": {
"kind": "test",
"isDefault": true
},
"presentation": {
"echo": true,
"reveal": "always",
"focus": true,
"panel": "dedicated",
"showReuseMessage": true,
"clear": false
},
"problemMatcher": [
{
"owner": "powershell",
"fileLocation": [
"absolute"
],
"severity": "error",
"pattern": [
{
"regexp": "^\\s*(\\[-\\]\\s*.*?)(\\d+)ms\\s*$",
"message": 1
},
{
"regexp": "(.*)",
"code": 1
},
{
"regexp": ""
},
{
"regexp": "^.*,\\s*(.*):\\s*line\\s*(\\d+).*",
"file": 1,
"line": 2
}
]
}
]
},
{
"label": "test-with-coverage",
"type": "shell",
"command": "./build.ps1 -Tasks noop;Invoke-PesterJob -Path './tests/Unit/Classes','./tests/Unit/Private','./tests/Unit/Public','./tests/QA'",
"group": {
"kind": "test",
"isDefault": false
},
"presentation": {
"echo": true,
"reveal": "always",
Expand Down Expand Up @@ -133,15 +176,8 @@
{
"label": "hqrmtest",
"type": "shell",
"command": "&${cwd}/build.ps1",
"args": [
"-AutoRestore",
"-UseModuleFast",
"-Tasks",
"hqrmtest",
"-CodeCoverageThreshold",
"0"
],
"command": "./build.ps1 -AutoRestore -UseModuleFast -Tasks hqrmtest -CodeCoverageThreshold 0",
"args": [],
"presentation": {
"echo": true,
"reveal": "always",
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
`Get-SqlDscServerPermission`, and `Get-SqlDscTraceFlag`.
- New-SqlDscDatabase: use `New-ArgumentException` instead of
`New-InvalidArgumentException` for parameter validation errors.
- Updated `.gitattributes` to enforce LF line endings for PowerShell files to
ensure cross-platform compatibility.
- Updated GitHub Copilot setup workflow to fix environment variable assignment.
- Updated VS Code tasks configuration to use proper build and test commands
with improved task grouping and problem matchers.
- Updated instruction files to use correct build command (`noop` instead of
`build`) and fixed file pattern matching syntax.

### Added

Expand Down
Loading