Change New-FileCatalog -CatalogVersion default to 2 (#20428)

This commit is contained in:
Thomas Nieto
2023-10-16 15:26:31 -07:00
committed by GitHub
parent a0e6807bb2
commit 4621c9e571
2 changed files with 15 additions and 15 deletions
@@ -70,7 +70,7 @@ Describe "Test suite for NewFileCatalogAndTestFileCatalogCmdlets" -Tags "CI" {
try
{
$null = New-FileCatalog -Path $sourcePath -CatalogFilePath $catalogPath -CatalogVersion 1.0
$null = New-FileCatalog -Path $sourcePath -CatalogFilePath $catalogPath -CatalogVersion 1
$result = Test-FileCatalog -Path $sourcePath -CatalogFilePath $catalogPath -Detailed
}
finally
@@ -103,7 +103,7 @@ Describe "Test suite for NewFileCatalogAndTestFileCatalogCmdlets" -Tags "CI" {
# Validate result properties
$result.Status | Should -Be "Valid"
$result.Signature.Status | Should -Be "NotSigned"
$result.HashAlgorithm | Should -Be "SHA1"
$result.HashAlgorithm | Should -Be "SHA256"
}
It "NewFileCatalogWithSingleFile" {
@@ -135,7 +135,7 @@ Describe "Test suite for NewFileCatalogAndTestFileCatalogCmdlets" -Tags "CI" {
try
{
$null = New-FileCatalog -Path "$testDataPath\TestImage.gif","$testDataPath\TestFileCatalog.txt" -CatalogFilePath $catalogPath -CatalogVersion 1.0
$null = New-FileCatalog -Path "$testDataPath\TestImage.gif","$testDataPath\TestFileCatalog.txt" -CatalogFilePath $catalogPath -CatalogVersion 1
$result = Test-FileCatalog -Path "$testDataPath\TestImage.gif","$testDataPath\TestFileCatalog.txt" -CatalogFilePath ($catalogPath + "\catalog.cat") -Detailed
}
finally
@@ -170,7 +170,7 @@ Describe "Test suite for NewFileCatalogAndTestFileCatalogCmdlets" -Tags "CI" {
try
{
$null =New-FileCatalog -Path $catalogDataPath -CatalogFilePath $catalogPath -CatalogVersion 1.0
$null =New-FileCatalog -Path $catalogDataPath -CatalogFilePath $catalogPath -CatalogVersion 1
$result = Test-FileCatalog -Path $catalogDataPath -CatalogFilePath $catalogPath -Detailed
}
finally
@@ -209,7 +209,7 @@ Describe "Test suite for NewFileCatalogAndTestFileCatalogCmdlets" -Tags "CI" {
try
{
$null = New-FileCatalog -Path $catalogDataPath -CatalogFilePath $catalogPath -CatalogVersion 2.0
$null = New-FileCatalog -Path $catalogDataPath -CatalogFilePath $catalogPath -CatalogVersion 2
$result = Test-FileCatalog -Path $catalogDataPath -CatalogFilePath $catalogPath -Detailed
}
finally
@@ -235,7 +235,7 @@ Describe "Test suite for NewFileCatalogAndTestFileCatalogCmdlets" -Tags "CI" {
Copy-Item "$testDataPath\UserConfigProv" $env:temp -Recurse -ErrorAction SilentlyContinue
Push-Location "$env:TEMP\UserConfigProv"
# When -Path is not specified, it should use current directory
$null = New-FileCatalog -CatalogFilePath $catalogPath -CatalogVersion 1.0
$null = New-FileCatalog -CatalogFilePath $catalogPath -CatalogVersion 1
$result = Test-FileCatalog -CatalogFilePath $catalogPath
if($result -ne 'Valid')
@@ -286,7 +286,7 @@ Describe "Test suite for NewFileCatalogAndTestFileCatalogCmdlets" -Tags "CI" {
try
{
$null = New-FileCatalog -Path $catalogDataPath -CatalogFilePath $catalogPath -CatalogVersion 2.0
$null = New-FileCatalog -Path $catalogDataPath -CatalogFilePath $catalogPath -CatalogVersion 2
$result = Test-FileCatalog -Path $catalogDataPath -CatalogFilePath $catalogPath -Detailed
}
finally
@@ -315,7 +315,7 @@ Describe "Test suite for NewFileCatalogAndTestFileCatalogCmdlets" -Tags "CI" {
It "TestCatalogWhenNewFileAddedtoFolderBeforeValidation" {
$script:catalogPath = "$env:TEMP\TestCatalogWhenNewFileAddedtoFolderBeforeValidation.cat"
$null = New-FileCatalog -Path $testDataPath\UserConfigProv\ -CatalogFilePath $script:catalogPath -CatalogVersion 2.0
$null = New-FileCatalog -Path $testDataPath\UserConfigProv\ -CatalogFilePath $script:catalogPath -CatalogVersion 2
$null = Copy-Item $testDataPath\UserConfigProv $env:temp -Recurse -ErrorAction SilentlyContinue
$null = New-Item $env:temp\UserConfigProv\DSCResources\NewFile.txt -ItemType File
Add-Content $env:temp\UserConfigProv\DSCResources\NewFile.txt -Value "More Data" -Force
@@ -335,7 +335,7 @@ Describe "Test suite for NewFileCatalogAndTestFileCatalogCmdlets" -Tags "CI" {
It "TestCatalogWhenNewFileDeletedFromFolderBeforeValidation" {
$script:catalogPath = "$env:TEMP\TestCatalogWhenNewFileDeletedFromFolderBeforeValidation.cat"
$null = New-FileCatalog -Path $testDataPath\UserConfigProv\ -CatalogFilePath $script:catalogPath -CatalogVersion 1.0
$null = New-FileCatalog -Path $testDataPath\UserConfigProv\ -CatalogFilePath $script:catalogPath -CatalogVersion 1
$null = Copy-Item $testDataPath\UserConfigProv $env:temp -Recurse -ErrorAction SilentlyContinue
del $env:temp\UserConfigProv\DSCResources\UserConfigProviderModVersion1\UserConfigProviderModVersion1.psm1 -Force -ErrorAction SilentlyContinue
$result = Test-FileCatalog -Path $env:temp\UserConfigProv -CatalogFilePath $script:catalogPath -Detailed
@@ -354,7 +354,7 @@ Describe "Test suite for NewFileCatalogAndTestFileCatalogCmdlets" -Tags "CI" {
It "TestCatalogWhenFileContentModifiedBeforeValidation" {
$script:catalogPath = "$env:TEMP\TestCatalogWhenFileContentModifiedBeforeValidation.cat"
$null = New-FileCatalog -Path $testDataPath\UserConfigProv\ -CatalogFilePath $script:catalogPath -CatalogVersion 1.0
$null = New-FileCatalog -Path $testDataPath\UserConfigProv\ -CatalogFilePath $script:catalogPath -CatalogVersion 1
$null = Copy-Item $testDataPath\UserConfigProv $env:temp -Recurse -ErrorAction SilentlyContinue
Add-Content $env:temp\UserConfigProv\DSCResources\UserConfigProviderModVersion1\UserConfigProviderModVersion1.psm1 -Value "More Data" -Force
$result = Test-FileCatalog -Path $env:temp\UserConfigProv -CatalogFilePath $script:catalogPath -Detailed
@@ -381,7 +381,7 @@ Describe "Test suite for NewFileCatalogAndTestFileCatalogCmdlets" -Tags "CI" {
It "TestCatalogSkipSingleFileDuringValidation" {
$script:catalogPath = "$env:TEMP\TestCatalogSkipSingleFileDuringValidation.cat"
$null = New-FileCatalog -Path $testDataPath\UserConfigProv\ -CatalogFilePath $script:catalogPath -CatalogVersion 2.0
$null = New-FileCatalog -Path $testDataPath\UserConfigProv\ -CatalogFilePath $script:catalogPath -CatalogVersion 2
$result = Test-FileCatalog -Path $testDataPath\UserConfigProv\ -CatalogFilePath $script:catalogPath -FilesToSkip "scriptdsc.schema"
$result | Should -Be "Valid"
}
@@ -389,7 +389,7 @@ Describe "Test suite for NewFileCatalogAndTestFileCatalogCmdlets" -Tags "CI" {
It "TestCatalogSkipCertainFileTypeDuringValidation" {
$script:catalogPath = "$env:TEMP\TestCatalogSkipCertainFileTypeDuringValidation.cat"
$null = New-FileCatalog -Path $testDataPath\UserConfigProv\ -CatalogFilePath $script:catalogPath -CatalogVersion 2.0
$null = New-FileCatalog -Path $testDataPath\UserConfigProv\ -CatalogFilePath $script:catalogPath -CatalogVersion 2
$result = Test-FileCatalog -Path $testDataPath\UserConfigProv\ -CatalogFilePath $script:catalogPath -FilesToSkip "*.mof"
$result | Should -Be "Valid"
}
@@ -397,7 +397,7 @@ Describe "Test suite for NewFileCatalogAndTestFileCatalogCmdlets" -Tags "CI" {
It "TestCatalogSkipWildCardPatternDuringValidation" {
$script:catalogPath = "$env:TEMP\TestCatalogSkipWildCardPatternDuringValidation.cat"
$null = New-FileCatalog -Path $testDataPath\UserConfigProv\ -CatalogFilePath $script:catalogPath -CatalogVersion 1.0
$null = New-FileCatalog -Path $testDataPath\UserConfigProv\ -CatalogFilePath $script:catalogPath -CatalogVersion 1
$result = Test-FileCatalog -Path $testDataPath\UserConfigProv\ -CatalogFilePath $script:catalogPath -FilesToSkip "UserConfigProvider*.psm1"
$result | Should -Be "Valid"
}
@@ -405,7 +405,7 @@ Describe "Test suite for NewFileCatalogAndTestFileCatalogCmdlets" -Tags "CI" {
It "TestCatalogSkipMultiplePattensDuringValidation" {
$script:catalogPath = "$env:TEMP\TestCatalogSkipMultiplePattensDuringValidation.cat"
$null = New-FileCatalog -Path $testDataPath\UserConfigProv\ -CatalogFilePath $script:catalogPath -CatalogVersion 1.0
$null = New-FileCatalog -Path $testDataPath\UserConfigProv\ -CatalogFilePath $script:catalogPath -CatalogVersion 1
$result = Test-FileCatalog -Path $testDataPath\UserConfigProv\ -CatalogFilePath $script:catalogPath -FilesToSkip "*.psd1","UserConfigProviderModVersion2.psm1","*ModVersion1.schema.mof"
$result | Should -Be "Valid"
}