特定のフォルダとファイルが存在するかどうかを確認するpesterテストを作成しました。 pesterテストは素晴らしいですが、-Verboseオプションを指定してテストを呼び出すと、修正候補を追加したかったのです。しかし、私は実際のテストに-Verboseパラメータを取得することはできません。-VerboseがPowerShellのPester Testで動作しない
フォルダ/ファイル構造:
$Here = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)"
Describe "Module Minimum Requirements Tests. Use -Verbose for Suggested Fixes" -Tags Module {
Context "Test: Verify File Counts = 1" {
Write-Verbose "If you receive an error, verify there is only 'ONE' PSD1 File and only 'ONE' PSM1 File."
It "There is only one PSD1 file" { (Get-ChildItem "$Here\..\" *.psd1).count | Should be 1 }
It "There is only one PSM1 file" { (Get-ChildItem "$Here\..\" *.psm1).count | Should be 1 }
}
}