Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 6fc0762

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

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

‎TOOL-Repair-ScriptFormat/Repair-ScriptFormat.ps1

Lines changed: 4 additions & 4 deletions
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)

AltStyle によって変換されたページ (->オリジナル) /