Skip to content
This repository has been archived by the owner on Jun 14, 2024. It is now read-only.

Fix CI Pipeline and Opt-in to Meta Tests #200

Open
wants to merge 4 commits into
base: dev
Choose a base branch
from
Open
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
7 changes: 7 additions & 0 deletions .MetaTestOptIn.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
[
"Common Tests - Custom Script Analyzer Rules",
"Common Tests - Flagged Script Analyzer Rules",
"Common Tests - New Error-Level Script Analyzer Rules",
"Common Tests - Relative Path Length",
"Common Tests - Required Script Analyzer Rules",
"Common Tests - Validate Markdown Files",
"Common Tests - Validate Markdown Links",
"Common Tests - Validate Module Files",
"Common Tests - Validate Script Files",
"Common Tests - Relative Path Length"
Expand Down
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,17 @@

## Unreleased

* Fixed CI pipeline by limiting Pester module version to 4.10.1 - [Issue #199](https://github.com/PowerShell/PSDscResources/issues/199)
* Correct build badge for `dev` branch.
* Opt-in to the following Meta tests:
* Common Tests - Custom Script Analyzer Rules.
* Common Tests - Flagged Script Analyzer Rules.
* Common Tests - New Error-Level Script Analyzer Rules.
* Common Tests - Relative Path Length.
* Common Tests - Required Script Analyzer Rules.
* Common Tests - Validate Markdown Links.
* Common Tests - Validate Markdown Files.

## 2.12.0.0

* Ports style fixes that were recently made in xPSDesiredStateConfiguration
Expand Down
8 changes: 4 additions & 4 deletions DscResources/MSFT_GroupResource/MSFT_GroupResource.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -1003,7 +1003,7 @@ function Set-TargetResourceOnNanoServer
#>
foreach ($includedMember in $uniqueMembersToInclude)
{
foreach($excludedMember in $uniqueMembersToExclude)
foreach ($excludedMember in $uniqueMembersToExclude)
{
if ($includedMember -eq $excludedMember)
{
Expand All @@ -1022,7 +1022,7 @@ function Set-TargetResourceOnNanoServer
}
}

foreach($excludedMember in $uniqueMembersToExclude)
foreach ($excludedMember in $uniqueMembersToExclude)
{
if ($groupMembers -contains $excludedMember)
{
Expand Down Expand Up @@ -1496,7 +1496,7 @@ function Test-TargetResourceOnNanoServer
#>
foreach ($includedMember in $uniqueMembersToInclude)
{
foreach($excludedMember in $uniqueMembersToExclude)
foreach ($excludedMember in $uniqueMembersToExclude)
{
if ($includedMember -eq $excludedMember)
{
Expand All @@ -1515,7 +1515,7 @@ function Test-TargetResourceOnNanoServer
}
}

foreach($excludedMember in $uniqueMembersToExclude)
foreach ($excludedMember in $uniqueMembersToExclude)
{
if ($groupMembers -contains $excludedMember)
{
Expand Down
13 changes: 8 additions & 5 deletions DscResources/MSFT_MsiPackage/MSFT_MsiPackage.psm1
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# Suppress Global Vars PSSA Error because $global:DSCMachineStatus must be allowed
[Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidGlobalVars', '')]
[Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseShouldProcessForStateChangingFunctions', '')]
param()

param ()

$errorActionPreference = 'Stop'
Set-StrictMode -Version 'Latest'
Expand Down Expand Up @@ -329,10 +330,12 @@ function Set-TargetResource
missing on some client SKUs (worked on both Server and Client Skus in Windows 10).
#>
$serverFeatureData = Invoke-CimMethod -Name 'GetServerFeature' `
-Namespace 'root\microsoft\windows\servermanager' `
-Class 'MSFT_ServerManagerTasks' `
-Arguments @{ BatchSize = 256 } `
-ErrorAction 'Ignore'
-Namespace 'root\microsoft\windows\servermanager' `
-Class 'MSFT_ServerManagerTasks' `
-Arguments @{
BatchSize = 256
} `
-ErrorAction 'Ignore'

$registryData = Get-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager' -Name 'PendingFileRenameOperations' -ErrorAction 'Ignore'

Expand Down
3 changes: 2 additions & 1 deletion DscResources/MSFT_UserResource/MSFT_UserResource.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,7 @@ function Get-TargetResourceOnFullSKU
#>
function Set-TargetResourceOnFullSKU
{
[Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSShouldProcess', '')]
[CmdletBinding(SupportsShouldProcess = $true)]
param
(
Expand Down Expand Up @@ -1125,7 +1126,7 @@ function Test-TargetResourceOnNanoServer

if ($PSBoundParameters.ContainsKey('Password'))
{
if(-not (Test-CredentialsValidOnNanoServer -UserName $UserName -Password $Password.Password))
if (-not (Test-CredentialsValidOnNanoServer -UserName $UserName -Password $Password.Password))
{
# The Password property does not match
Write-Verbose -Message ($script:localizedData.PasswordPropertyMismatch -f 'Password')
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ no contributions should be made directly to this branch.

### dev

[![Build status](https://ci.appveyor.com/api/projects/status/9nsi30ladk1jaax5/branch/master?svg=true)](https://ci.appveyor.com/project/PowerShell/AuditPolicyDsc/branch/dev)
[![codecov](https://codecov.io/gh/PowerShell/AuditPolicyDsc/branch/dev/graph/badge.svg)](https://codecov.io/gh/PowerShell/AuditPolicyDsc/branch/dev)
[![Build status](https://ci.appveyor.com/api/projects/status/9uf3wyys7ky7776d/branch/master?svg=true)](https://ci.appveyor.com/project/PowerShell/psdscresources/branch/dev)
[![codecov](https://codecov.io/gh/PowerShell/PSDscResources/branch/dev/graph/badge.svg)](https://codecov.io/gh/PowerShell/PSDscResources)

This is the development branch
to which contributions should be proposed by contributors as pull requests.
Expand Down
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ install:
- ps: |
$moduleName = 'PSDscResources'
Import-Module "$env:APPVEYOR_BUILD_FOLDER\DscResource.Tests\AppVeyor.psm1"
Invoke-AppveyorInstallTask
Invoke-AppveyorInstallTask -PesterMaximumVersion 4.10.1

#---------------------------------#
# build configuration #
Expand Down