Skip to content

Commit 1b5fd01

Browse files
committed
Replace $Error
1 parent e49256c commit 1b5fd01

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

O365-Update-O365UserUPNSuffix/Update-O365UserUPNSuffix.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ function Update-O365UserUPNSuffix {
111111
}
112112
}
113113
CATCH {
114-
$Error[0].Exception.Message
114+
$PSCmdlet.ThrowTerminatingError($_)
115115
}
116116
}
117117
PROCESS {
@@ -144,7 +144,7 @@ function Update-O365UserUPNSuffix {
144144
}
145145
}
146146
CATCH {
147-
$Error[0].Exception.Message
147+
$PSCmdlet.ThrowTerminatingError($_)
148148
}
149149
}
150150
END {

0 commit comments

Comments
 (0)