Skip to content

Commit 6fc0762

Browse files
committed
add error handling
1 parent 1b5fd01 commit 6fc0762

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Diff for: TOOL-Repair-ScriptFormat/Repair-ScriptFormat.ps1

+4-4
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ function Repair-ScriptFormat {
1313
}
1414

1515
process {
16+
try{
1617
# Retrieve content
1718
$scriptContent = Get-Content -Path $Path -Raw
1819

@@ -23,11 +24,10 @@ function Repair-ScriptFormat {
2324
#$NewContent = $NewContent -replace '\'
2425

2526
$NewContent | Out-File -FilePath $Path -Force -NoNewline
26-
27-
28-
27+
}catch{
28+
$PSCmdlet.ThrowTerminatingError($_)
29+
}
2930
}
3031
end {
31-
3232
}
3333
}

0 commit comments

Comments
 (0)