Skip to content

Commit

Permalink
file list
Browse files Browse the repository at this point in the history
  • Loading branch information
james-garriss committed Jun 24, 2024
1 parent c91cff0 commit 8d7554d
Showing 1 changed file with 18 additions and 15 deletions.
33 changes: 18 additions & 15 deletions utils/DeployUtils.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,8 @@ function SignScubaGearModule {
$FileList = CreateFileList `
-SourcePath $ModulePath `
-Extensions "*.ps1", "*.psm1", "*.psd1" # Array of extensions

Write-Host "The file list is $FileList"

Write-Host ">> Calling CallAzureSignTool function to sign scripts, manifest, and modules..."
CallAzureSignTool `
-AzureKeyVaultUrl $AzureKeyVaultUrl `
Expand All @@ -397,7 +398,7 @@ function SignScubaGearModule {

# New-FileCatlog creates a Windows catalog file (.cat) containing cryptographic hashes
# for files and folders in the specified paths.
$CatalogFilePath = New-FileCatalog -Path $ModulePath -CatalogFilePath $CatalogFilePath -CatalogVersion 2.0
$CatalogFilePath = New-FileCatalog -Path $ModulePath -CatalogFilePath $CatalogFilePath -CatalogVersion 2.0 -Verbose
Write-Host ">> The catalog path is $CatalogFilePath"
$CatalogList = New-TemporaryFile
$CatalogFilePath.FullName | Out-File -FilePath $CatalogList -Encoding utf8 -Force
Expand All @@ -414,19 +415,21 @@ function SignScubaGearModule {
# Signing tool says it was successful, but the test says it was not.
Write-Host ">> Testing the catalog"
# There's no -Path parameter.
$TestResult = Test-FileCatalog -CatalogFilePath $CatalogFilePath -Path $ModulePath -Detailed

ForEach ($File in $FileList) {
Write-Host $File
}
if ($TestResult -eq 'Valid') {
Write-Host ">> Signing the module was successful."
return True
}
else {
Write-Host ">> Signing the module was NOT successful."
return False
}
Test-FileCatalog -CatalogFilePath $CatalogFilePath -Path $ModulePath -Detailed
# $TestResult = Test-FileCatalog -CatalogFilePath $CatalogFilePath -Path $ModulePath -Detailed

# ForEach ($File in $FileList) {
# Write-Host $File
# }
# if ($TestResult -eq 'Valid') {
# Write-Host ">> Signing the module was successful."
# return True
# }
# else {
# Write-Host ">> Signing the module was NOT successful."
# return False
# }
return False
}

function CallAzureSignTool {
Expand Down

0 comments on commit 8d7554d

Please sign in to comment.