Guest User

Untitled

a guest
Jul 23rd, 2018
329
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. #This stores the array of the number of passed and failed test
  2. $passed = @()
  3. $failed = @()
  4.  
  5. Describe "Template Syntax" {
  6.  
  7. It "Has a JSON template" {
  8. $fileLocation = "$hereazuredeploy.json"
  9. $fileCheck = $fileLocation | Test-Path
  10.  
  11. if ($fileCheck -eq $true) { $passed = $passed + 1
  12. Write-Host "1st file exist " }
  13. if ($fileCheck -eq $false) { $failed = $failed + 1
  14. Write-Host "1st file does exist" }
  15.  
  16. }
  17.  
  18. It "Has a parameters file" {
  19. $fileLocation ="$hereazuredeploy.parameters*.json"
  20.  
  21. $fileCheck = $fileLocation | Test-Path
  22.  
  23. if ($fileCheck -eq $true) { $passed = $passed + 1;
  24. Write-Host "2nd file exist "}
  25. if ($fileCheck -eq $false) { $failed = $failed + 1
  26. Write-Host "2nd file does exist" }
  27.  
  28. }
  29.  
  30. PrintArgs
  31.  
  32. }
  33.  
  34. function PrintArgs(){
  35. Write-Host -ForegroundColor yellow "Passed: $($passed.Length) Failed: $($failed.Length)"
  36. }
Add Comment
Please, Sign In to add comment