Glossary: Command Line for IT: Bash and PowerShell
try/catch
Also written: try, catch
In PowerShell, try { } catch { } runs the catch block when a command in try fails. Cmdlet errors only count if you add -ErrorAction Stop.
Glossary: Command Line for IT: Bash and PowerShell
Also written: try, catch
In PowerShell, try { } catch { } runs the catch block when a command in try fails. Cmdlet errors only count if you add -ErrorAction Stop.