From 0e5d7b898f7a639813cf818baf6fdcacfcd407e5 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Thu, 1 Jul 2021 07:26:20 +0100 Subject: [PATCH] Convert bat to powershell: diffing --- differences/json.groovy | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/differences/json.groovy b/differences/json.groovy index 82b5293..b195883 100644 --- a/differences/json.groovy +++ b/differences/json.groovy @@ -39,9 +39,9 @@ def comparefiles(importedjsonfile, currentjsonfile) { # echo Diffing sorted json files \$str1 = Get-Content "temp1.txt" \$str2 = Get-Content "temp2.txt" - \$diff = Compare-Object \$str1 \$str2 - if (\$diff -ne '') { - echo "Difference between JSON files: \$diff" + \$diffed = Compare-Object \$str1 \$str2 + if (\$diffed -ne '') { + Write-Output "Difference between JSON files: \$diffed" exit 1 }