From 2104d1ae96191571bbfc8e806942458f525b9f7b Mon Sep 17 00:00:00 2001 From: Kaleb Luedtke Date: Thu, 31 Oct 2024 23:15:10 -0500 Subject: [PATCH 1/8] Start GitDsc Tests --- resources/GitDsc/GitDsc.psd1 | 169 +++++++++++++++++----------------- tests/GitDsc/GitDsc.Tests.ps1 | 34 +++++++ 2 files changed, 118 insertions(+), 85 deletions(-) create mode 100644 tests/GitDsc/GitDsc.Tests.ps1 diff --git a/resources/GitDsc/GitDsc.psd1 b/resources/GitDsc/GitDsc.psd1 index ddaa013b..5903ad54 100644 --- a/resources/GitDsc/GitDsc.psd1 +++ b/resources/GitDsc/GitDsc.psd1 @@ -8,130 +8,129 @@ @{ -# Script module or binary module file associated with this manifest. -RootModule = 'GitDsc.psm1' + # Script module or binary module file associated with this manifest. + RootModule = 'GitDsc.psm1' -# Version number of this module. -ModuleVersion = '0.1.0' + # Version number of this module. + ModuleVersion = '0.1.1' -# Supported PSEditions -# CompatiblePSEditions = @() + # Supported PSEditions + # CompatiblePSEditions = @() -# ID used to uniquely identify this module -GUID = 'd5c78779-2fa7-4356-87cb-13bb41102e7e' + # ID used to uniquely identify this module + GUID = 'd5c78779-2fa7-4356-87cb-13bb41102e7e' -# Author of this module -Author = 'DscSamples' + # Author of this module + Author = 'DscSamples' -# Company or vendor of this module -# CompanyName = '' + # Company or vendor of this module + # CompanyName = '' -# Copyright statement for this module -# Copyright = '' + # Copyright statement for this module + # Copyright = '' -# Description of the functionality provided by this module -Description = 'DSC Resource for Git' + # Description of the functionality provided by this module + Description = 'DSC Resource for Git' -# Minimum version of the PowerShell engine required by this module -# PowerShellVersion = '' + # Minimum version of the PowerShell engine required by this module + # PowerShellVersion = '' -# Name of the PowerShell host required by this module -# PowerShellHostName = '' + # Name of the PowerShell host required by this module + # PowerShellHostName = '' -# Minimum version of the PowerShell host required by this module -# PowerShellHostVersion = '' + # Minimum version of the PowerShell host required by this module + # PowerShellHostVersion = '' -# Minimum version of Microsoft .NET Framework required by this module. This prerequisite is valid for the PowerShell Desktop edition only. -# DotNetFrameworkVersion = '' + # Minimum version of Microsoft .NET Framework required by this module. This prerequisite is valid for the PowerShell Desktop edition only. + # DotNetFrameworkVersion = '' -# Minimum version of the common language runtime (CLR) required by this module. This prerequisite is valid for the PowerShell Desktop edition only. -# ClrVersion = '' + # Minimum version of the common language runtime (CLR) required by this module. This prerequisite is valid for the PowerShell Desktop edition only. + # ClrVersion = '' -# Processor architecture (None, X86, Amd64) required by this module -# ProcessorArchitecture = '' + # Processor architecture (None, X86, Amd64) required by this module + # ProcessorArchitecture = '' -# Modules that must be imported into the global environment prior to importing this module -# RequiredModules = @() + # Modules that must be imported into the global environment prior to importing this module + # RequiredModules = @() -# Assemblies that must be loaded prior to importing this module -# RequiredAssemblies = @() + # Assemblies that must be loaded prior to importing this module + # RequiredAssemblies = @() -# Script files (.ps1) that are run in the caller's environment prior to importing this module. -# ScriptsToProcess = @() + # Script files (.ps1) that are run in the caller's environment prior to importing this module. + # ScriptsToProcess = @() -# Type files (.ps1xml) to be loaded when importing this module -# TypesToProcess = @() + # Type files (.ps1xml) to be loaded when importing this module + # TypesToProcess = @() -# Format files (.ps1xml) to be loaded when importing this module -# FormatsToProcess = @() + # Format files (.ps1xml) to be loaded when importing this module + # FormatsToProcess = @() -# Modules to import as nested modules of the module specified in RootModule/ModuleToProcess -# NestedModules = @() + # Modules to import as nested modules of the module specified in RootModule/ModuleToProcess + # NestedModules = @() -# Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export. -# FunctionsToExport = @() + # Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export. + # FunctionsToExport = @() -# Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export. -# CmdletsToExport = @() + # Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export. + # CmdletsToExport = @() -# Variables to export from this module -# VariablesToExport = '*' + # Variables to export from this module + # VariablesToExport = '*' -# Aliases to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no aliases to export. -# AliasesToExport = @() + # Aliases to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no aliases to export. + # AliasesToExport = @() -# DSC resources to export from this module -DscResourcesToExport = @( - 'GitClone', - 'GitRemote', - 'GitConfigUserName', - 'GitConfigUserEmail', - 'GitConfigFile' -) + # DSC resources to export from this module + DscResourcesToExport = @( + 'GitClone', + 'GitRemote', + 'GitConfigUserName', + 'GitConfigUserEmail' + ) -# List of all modules packaged with this module -# ModuleList = @() + # List of all modules packaged with this module + # ModuleList = @() -# List of all files packaged with this module -# FileList = @() + # List of all files packaged with this module + # FileList = @() -# Private data to pass to the module specified in RootModule/ModuleToProcess. This may also contain a PSData hashtable with additional module metadata used by PowerShell. -PrivateData = @{ + # Private data to pass to the module specified in RootModule/ModuleToProcess. This may also contain a PSData hashtable with additional module metadata used by PowerShell. + PrivateData = @{ - PSData = @{ + PSData = @{ - # Tags applied to this module. These help with module discovery in online galleries. - Tags = @('PSDscResource_GitClone', 'PSDscResource_GitRemote', 'PSDscResource_GitConfigUserName', 'PSDscResource_GitConfigUserEmail', 'PSDscResource_GitConfigFile') + # Tags applied to this module. These help with module discovery in online galleries. + Tags = @('PSDscResource_GitClone', 'PSDscResource_GitRemote', 'PSDscResource_GitConfigUserName', 'PSDscResource_GitConfigUserEmail') - # A URL to the license for this module. - # LicenseUri = '' + # A URL to the license for this module. + # LicenseUri = '' - # A URL to the main website for this project. - # ProjectUri = '' + # A URL to the main website for this project. + # ProjectUri = '' - # A URL to an icon representing this module. - # IconUri = '' + # A URL to an icon representing this module. + # IconUri = '' - # ReleaseNotes of this module - # ReleaseNotes = '' + # ReleaseNotes of this module + # ReleaseNotes = '' - # Prerelease string of this module - Prerelease = 'alpha' + # Prerelease string of this module + Prerelease = 'alpha' - # Flag to indicate whether the module requires explicit user acceptance for install/update/save - # RequireLicenseAcceptance = $false + # Flag to indicate whether the module requires explicit user acceptance for install/update/save + # RequireLicenseAcceptance = $false - # External dependent modules of this module - # ExternalModuleDependencies = @() + # External dependent modules of this module + # ExternalModuleDependencies = @() - } # End of PSData hashtable + } # End of PSData hashtable -} # End of PrivateData hashtable + } # End of PrivateData hashtable -# HelpInfo URI of this module -# HelpInfoURI = '' + # HelpInfo URI of this module + # HelpInfoURI = '' -# Default prefix for commands exported from this module. Override the default prefix using Import-Module -Prefix. -# DefaultCommandPrefix = '' + # Default prefix for commands exported from this module. Override the default prefix using Import-Module -Prefix. + # DefaultCommandPrefix = '' } diff --git a/tests/GitDsc/GitDsc.Tests.ps1 b/tests/GitDsc/GitDsc.Tests.ps1 new file mode 100644 index 00000000..467addf2 --- /dev/null +++ b/tests/GitDsc/GitDsc.Tests.ps1 @@ -0,0 +1,34 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. +using module GitDsc + +$ErrorActionPreference = "Stop" +Set-StrictMode -Version Latest + +<# +.Synopsis + Pester tests related to the GitDsc PowerShell module. +#> + +BeforeAll { + if ($null -eq (Get-Module -ListAvailable -Name PSDesiredStateConfiguration)) + { + Install-Module -Name PSDesiredStateConfiguration -Force -SkipPublisherCheck + } + + Import-Module GitDsc +} + +Describe 'List available DSC resources' { + It 'Shows DSC Resources' { + $expectedDSCResources = 'GitClone', 'GitRemote', 'GitConfigUserName', 'GitConfigUserEmail' + $availableDSCResources = (Get-DscResource -Module GitDsc).Name + $availableDSCResources.count | Should -Be 4 + $availableDSCResources | Where-Object { $expectedDSCResources -notcontains $_ } | Should -BeNullOrEmpty -ErrorAction Stop + } +} + + +AfterAll { + # Clean up cloned folder +} \ No newline at end of file From 23fa12b24031dbad38588bdd415d7f432e06e3a5 Mon Sep 17 00:00:00 2001 From: Kaleb Luedtke Date: Thu, 31 Oct 2024 23:39:29 -0500 Subject: [PATCH 2/8] Add some initial tests for GitDsc --- tests/GitDsc/GitDsc.Tests.ps1 | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/tests/GitDsc/GitDsc.Tests.ps1 b/tests/GitDsc/GitDsc.Tests.ps1 index 467addf2..35ba91ab 100644 --- a/tests/GitDsc/GitDsc.Tests.ps1 +++ b/tests/GitDsc/GitDsc.Tests.ps1 @@ -17,6 +17,11 @@ BeforeAll { } Import-Module GitDsc + + # Create test folder for cloning into + $global:TestGitRoot = Join-Path -Path $env:TEMP -ChildPath $(New-Guid) + New-Item -ItemType Directory -Path $global:TestGitRoot -Force + $global:HttpsUrl = 'https://github.com/microsoft/winget-dsc.git' } Describe 'List available DSC resources' { @@ -28,7 +33,26 @@ Describe 'List available DSC resources' { } } +Describe 'GitClone' { + It 'New folder starts without cloned repo' { + $initialState = Invoke-DscResource -Name GitClone -ModuleName GitDsc -Method Get -Property @{ + HttpsUrl = $global:HttpsUrl + RootDirectory = $global:TestGitRoot + } + $initialState.Ensure | Should -Be 'Absent' + } + + It 'Able to clone repo' { + $desiredState = @{HttpsUrl = $global:HttpsUrl; RootDirectory = $global:TestGitRoot } + Invoke-DscResource -Name GitClone -ModuleName GitDsc -Method Set -Property $desiredState + $finalState = Invoke-DscResource -Name GitClone -ModuleName GitDsc -Method Get -Property $desiredState + $finalState.Ensure | Should -Be 'Present' + $testResult = Invoke-DscResource -Name GitClone -ModuleName GitDsc -Method Test -Property $desiredState + $testResult.InDesiredState | Should -Be $true + } +} AfterAll { # Clean up cloned folder + Remove-Item -Recurse -Force $global:TestGitRoot } \ No newline at end of file From f8e81adbbed7bf6b8aea69bd60546f7c6b0b3504 Mon Sep 17 00:00:00 2001 From: Kaleb Luedtke Date: Thu, 31 Oct 2024 23:43:37 -0500 Subject: [PATCH 3/8] Add editorconfig file for keeping things clean --- .editorconfig | 16 ++++++++++++++++ tests/GitDsc/GitDsc.Tests.ps1 | 4 ++-- 2 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 .editorconfig diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 00000000..c8a76aa7 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,16 @@ +# top-most EditorConfig file +root=true + +# Apply Windows-style newlines with a newline ending on every file, using UTF-8, and removing extra whitespace before newlines +[*] +end_of_line = crlf +insert_final_newline = true +charset = utf-8 +trim_trailing_whitespace = true + +# Overrides for Markdown Files - Use tab for indents (accessibility) +[*.md] +indent_style = tab + +[{allow.txt,excludes.txt,patterns.txt}] +end_of_line = lf \ No newline at end of file diff --git a/tests/GitDsc/GitDsc.Tests.ps1 b/tests/GitDsc/GitDsc.Tests.ps1 index 35ba91ab..a4154697 100644 --- a/tests/GitDsc/GitDsc.Tests.ps1 +++ b/tests/GitDsc/GitDsc.Tests.ps1 @@ -15,7 +15,7 @@ BeforeAll { { Install-Module -Name PSDesiredStateConfiguration -Force -SkipPublisherCheck } - + Import-Module GitDsc # Create test folder for cloning into @@ -55,4 +55,4 @@ Describe 'GitClone' { AfterAll { # Clean up cloned folder Remove-Item -Recurse -Force $global:TestGitRoot -} \ No newline at end of file +} From 6b9d07b4e9218f092a4e6e77f0fdd46992d9c56b Mon Sep 17 00:00:00 2001 From: Kaleb Luedtke Date: Sat, 2 Nov 2024 00:27:11 -0500 Subject: [PATCH 4/8] Found a way to mock out the functions inside the DSC Resource --- tests/GitDsc/GitDsc.Tests.ps1 | 80 ++++++++++++++++++++++++++--------- 1 file changed, 60 insertions(+), 20 deletions(-) diff --git a/tests/GitDsc/GitDsc.Tests.ps1 b/tests/GitDsc/GitDsc.Tests.ps1 index a4154697..c51877bc 100644 --- a/tests/GitDsc/GitDsc.Tests.ps1 +++ b/tests/GitDsc/GitDsc.Tests.ps1 @@ -17,11 +17,6 @@ BeforeAll { } Import-Module GitDsc - - # Create test folder for cloning into - $global:TestGitRoot = Join-Path -Path $env:TEMP -ChildPath $(New-Guid) - New-Item -ItemType Directory -Path $global:TestGitRoot -Force - $global:HttpsUrl = 'https://github.com/microsoft/winget-dsc.git' } Describe 'List available DSC resources' { @@ -33,26 +28,71 @@ Describe 'List available DSC resources' { } } -Describe 'GitClone' { - It 'New folder starts without cloned repo' { - $initialState = Invoke-DscResource -Name GitClone -ModuleName GitDsc -Method Get -Property @{ - HttpsUrl = $global:HttpsUrl - RootDirectory = $global:TestGitRoot +InModuleScope -ModuleName GitDsc { + Describe 'GitClone' { + + BeforeAll { + Mock Assert-Git { return $true } + Mock Invoke-GitClone -Verifiable + + $global:HttpsUrl = 'https://github.com/microsoft/winget-dsc.git' + $global:TestGitRoot = Join-Path -Path $env:TEMP -ChildPath $(New-Guid) } - $initialState.Ensure | Should -Be 'Absent' - } - It 'Able to clone repo' { - $desiredState = @{HttpsUrl = $global:HttpsUrl; RootDirectory = $global:TestGitRoot } - Invoke-DscResource -Name GitClone -ModuleName GitDsc -Method Set -Property $desiredState - $finalState = Invoke-DscResource -Name GitClone -ModuleName GitDsc -Method Get -Property $desiredState - $finalState.Ensure | Should -Be 'Present' - $testResult = Invoke-DscResource -Name GitClone -ModuleName GitDsc -Method Test -Property $desiredState - $testResult.InDesiredState | Should -Be $true + $script:gitCloneResource = [GitClone]::new() + Write-Output $gitCloneResource + + It 'New folder starts without cloned repo' { + $gitCloneResource.HttpsUrl = $global:HttpsUrl + $gitCloneResource.RootDirectory = $global:TestGitRoot + $initialState = $gitCloneResource.Get() + $initialState.Ensure | Should -Be 'Absent' + } + + It 'Set throws when ensuring absent' { + $gitCloneResource.Ensure = [Ensure]::Absent + { $gitCloneResource.Set() } | Should -Throw + } + + It 'Calls Invoke-GitClone when ensuring present' { + $gitCloneResource.HttpsUrl = $global:HttpsUrl + $gitCloneResource.RootDirectory = $global:TestGitRoot + $gitCloneResource.Ensure = [Ensure]::Present + # Run the setter + { $gitCloneResource.Set() } | Should -Not -Throw + # The setter should create the root directory if it doesn't exist + Test-Path $global:TestGitRoot | Should -Be $true + # Git clone should have been called once + Assert-MockCalled Invoke-GitClone -Exactly 1 + } + + It 'Test should fail when remote does not match' { + Mock Invoke-GitRemote { return 'https://github.com/Trenly/winget-dsc.git' } + + $gitCloneResource.HttpsUrl = $global:HttpsUrl + $gitCloneResource.RootDirectory = $global:TestGitRoot + $gitCloneResource.Ensure = [Ensure]::Present + + $gitCloneResource.Test() | Should -Be $false + } + + It 'Test should succeed when remote matches' { + # The folder has to be created here so that the DSC resource can attempt to fetch the remote from within it + New-Item -ItemType Directory -Path $(Join-Path -Path $global:TestGitRoot -ChildPath 'winget-dsc') -Force + + Mock Invoke-GitRemote -Verifiable { return 'https://github.com/microsoft/winget-dsc.git' } + + $gitCloneResource.HttpsUrl = $global:HttpsUrl + $gitCloneResource.RootDirectory = $global:TestGitRoot + $gitCloneResource.Ensure = [Ensure]::Present + + $gitCloneResource.Test() | Should -Be $true + Assert-MockCalled Invoke-GitRemote -Exactly 1 + } } } AfterAll { # Clean up cloned folder - Remove-Item -Recurse -Force $global:TestGitRoot + Remove-Item -Recurse -Force $global:TestGitRoot -ErrorAction 'SilentlyContinue' } From f1dcd5f78e614596735656db318a764c78eb0b7a Mon Sep 17 00:00:00 2001 From: Kaleb Luedtke Date: Mon, 4 Nov 2024 13:35:52 -0600 Subject: [PATCH 5/8] Revert Version --- resources/GitDsc/GitDsc.psd1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/GitDsc/GitDsc.psd1 b/resources/GitDsc/GitDsc.psd1 index 5903ad54..76469403 100644 --- a/resources/GitDsc/GitDsc.psd1 +++ b/resources/GitDsc/GitDsc.psd1 @@ -12,7 +12,7 @@ RootModule = 'GitDsc.psm1' # Version number of this module. - ModuleVersion = '0.1.1' + ModuleVersion = '0.1.0' # Supported PSEditions # CompatiblePSEditions = @() From b5b3a2978d7cba79f6a3a32ced95d009953b276e Mon Sep 17 00:00:00 2001 From: Kaleb Luedtke Date: Mon, 4 Nov 2024 21:38:27 -0600 Subject: [PATCH 6/8] Try fixing it again --- tests/GitDsc/GitDsc.Tests.ps1 | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/tests/GitDsc/GitDsc.Tests.ps1 b/tests/GitDsc/GitDsc.Tests.ps1 index c51877bc..69fb7423 100644 --- a/tests/GitDsc/GitDsc.Tests.ps1 +++ b/tests/GitDsc/GitDsc.Tests.ps1 @@ -16,7 +16,11 @@ BeforeAll { Install-Module -Name PSDesiredStateConfiguration -Force -SkipPublisherCheck } + # Because the module asserts that Git is installed before it will load, the function needs to be mocked + # This ensures that the tests can run even on a machine that does not have Git installed + Mock Assert-Git -ModuleName GitDsc { return $true } Import-Module GitDsc + } Describe 'List available DSC resources' { @@ -32,9 +36,7 @@ InModuleScope -ModuleName GitDsc { Describe 'GitClone' { BeforeAll { - Mock Assert-Git { return $true } Mock Invoke-GitClone -Verifiable - $global:HttpsUrl = 'https://github.com/microsoft/winget-dsc.git' $global:TestGitRoot = Join-Path -Path $env:TEMP -ChildPath $(New-Guid) } @@ -89,10 +91,13 @@ InModuleScope -ModuleName GitDsc { $gitCloneResource.Test() | Should -Be $true Assert-MockCalled Invoke-GitRemote -Exactly 1 } + + AfterAll { + # Clean up cloned folder + Remove-Item -Recurse -Force $global:TestGitRoot -ErrorAction 'SilentlyContinue' + } } } AfterAll { - # Clean up cloned folder - Remove-Item -Recurse -Force $global:TestGitRoot -ErrorAction 'SilentlyContinue' } From 44f66b85068746a45a4652a5bafa60960906ad6f Mon Sep 17 00:00:00 2001 From: Kaleb Luedtke Date: Tue, 5 Nov 2024 15:09:31 -0600 Subject: [PATCH 7/8] Lint --- resources/GitDsc/GitDsc.psm1 | 36 ++++++++++++----------------------- tests/GitDsc/GitDsc.Tests.ps1 | 5 ++--- 2 files changed, 14 insertions(+), 27 deletions(-) diff --git a/resources/GitDsc/GitDsc.psm1 b/resources/GitDsc/GitDsc.psm1 index e64d816b..ff80deaa 100644 --- a/resources/GitDsc/GitDsc.psm1 +++ b/resources/GitDsc/GitDsc.psm1 @@ -57,8 +57,7 @@ class GitClone { if ($gitRemoteValue -like $this.HttpsUrl) { $currentState.Ensure = [Ensure]::Present } - } - catch { + } catch { # Failed to execute `git remote`. Ensure state is `absent` } } @@ -114,8 +113,7 @@ class GitRemote { try { $gitRemoteValue = Invoke-GitRemote("get-url $($this.RemoteName)") $currentState.Ensure = ($gitRemoteValue -like $this.RemoteUrl) ? [Ensure]::Present : [Ensure]::Absent - } - catch { + } catch { $currentState.Ensure = [Ensure]::Absent } @@ -133,16 +131,13 @@ class GitRemote { if ($this.Ensure -eq [Ensure]::Present) { try { Invoke-GitRemote("add $($this.RemoteName) $($this.RemoteUrl)") - } - catch { + } catch { throw 'Failed to add remote repository.' } - } - else { + } else { try { Invoke-GitRemote("remove $($this.RemoteName)") - } - catch { + } catch { throw 'Failed to remove remote repository.' } } @@ -174,12 +169,10 @@ class GitConfigUserName { if ($this.ProjectDirectory) { if (Test-Path -Path $this.ProjectDirectory) { Set-Location $this.ProjectDirectory - } - else { + } else { throw 'Project directory does not exist.' } - } - else { + } else { throw 'Project directory parameter must be specified for non-system and non-global configurations.' } } @@ -206,8 +199,7 @@ class GitConfigUserName { if ($this.Ensure -eq [Ensure]::Present) { $configArgs = ConstructGitConfigUserArguments -Arguments "user.name '$($this.UserName)'" -ConfigLocation $this.ConfigLocation - } - else { + } else { $configArgs = ConstructGitConfigUserArguments -Arguments '--unset user.name' -ConfigLocation $this.ConfigLocation } @@ -240,12 +232,10 @@ class GitConfigUserEmail { if ($this.ProjectDirectory) { if (Test-Path -Path $this.ProjectDirectory) { Set-Location $this.ProjectDirectory - } - else { + } else { throw 'Project directory does not exist.' } - } - else { + } else { throw 'Project directory parameter must be specified for non-system and non-global configurations.' } } @@ -272,8 +262,7 @@ class GitConfigUserEmail { if ($this.Ensure -eq [Ensure]::Present) { $configArgs = ConstructGitConfigUserArguments -Arguments "user.email $($this.UserEmail)" -ConfigLocation $this.ConfigLocation - } - else { + } else { $configArgs = ConstructGitConfigUserArguments -Arguments '--unset user.email' -ConfigLocation $this.ConfigLocation } @@ -290,8 +279,7 @@ function Assert-Git { try { Invoke-Git -Command 'help' return - } - catch { + } catch { throw 'Git is not installed' } } diff --git a/tests/GitDsc/GitDsc.Tests.ps1 b/tests/GitDsc/GitDsc.Tests.ps1 index 69fb7423..a7b69578 100644 --- a/tests/GitDsc/GitDsc.Tests.ps1 +++ b/tests/GitDsc/GitDsc.Tests.ps1 @@ -2,7 +2,7 @@ # Licensed under the MIT License. using module GitDsc -$ErrorActionPreference = "Stop" +$ErrorActionPreference = 'Stop' Set-StrictMode -Version Latest <# @@ -11,8 +11,7 @@ Set-StrictMode -Version Latest #> BeforeAll { - if ($null -eq (Get-Module -ListAvailable -Name PSDesiredStateConfiguration)) - { + if ($null -eq (Get-Module -ListAvailable -Name PSDesiredStateConfiguration)) { Install-Module -Name PSDesiredStateConfiguration -Force -SkipPublisherCheck } From b142bde6158436341813b3e2e9c1c48ccf77e0c0 Mon Sep 17 00:00:00 2001 From: Kaleb Luedtke Date: Tue, 5 Nov 2024 15:13:13 -0600 Subject: [PATCH 8/8] Fix bad merge --- resources/GitDsc/GitDsc.psd1 | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/resources/GitDsc/GitDsc.psd1 b/resources/GitDsc/GitDsc.psd1 index eddf8279..15177152 100644 --- a/resources/GitDsc/GitDsc.psd1 +++ b/resources/GitDsc/GitDsc.psd1 @@ -85,8 +85,7 @@ 'GitClone', 'GitRemote', 'GitConfigUserName', - 'GitConfigUserEmail', - 'GitConfigFile' + 'GitConfigUserEmail' ) # List of all modules packaged with this module @@ -99,9 +98,22 @@ PrivateData = @{ PSData = @{ + + # Tags applied to this module. These help with module discovery in online galleries. + Tags = @( + 'PSDscResource_GitClone', + 'PSDscResource_GitRemote', + 'PSDscResource_GitConfigUserName', + 'PSDscResource_GitConfigUserEmail' + ) + # A URL to the license for this module. # LicenseUri = '' - Tags = @('PSDscResource_GitClone', 'PSDscResource_GitRemote', 'PSDscResource_GitConfigUserName', 'PSDscResource_GitConfigUserEmail') + + # A URL to the main website for this project. + # ProjectUri = '' + + # A URL to an icon representing this module. # IconUri = '' # ReleaseNotes of this module @@ -126,11 +138,4 @@ # Default prefix for commands exported from this module. Override the default prefix using Import-Module -Prefix. # DefaultCommandPrefix = '' -} - # HelpInfo URI of this module - # HelpInfoURI = '' - - # Default prefix for commands exported from this module. Override the default prefix using Import-Module -Prefix. - # DefaultCommandPrefix = '' - }