How to use PowerShell Try, Catch and the Write-Verbose and Write-Debug

preview_player
Показать описание
A look at a few key constructs to help handle errors and troubleshooting in your PowerShell scripts.

00:00 Introduction
00:45 Error variable
02:22 Custom error variable
03:25 Try-Catch
05:01 ErrorAction
06:45 Error details
08:35 Error specific Catch
09:37 ErrorActionPreference
13:25 Messages in scripts
15:09 Using CmdletBinding, Write-Verbose and Write-Debug
17:43 Summary and close
Рекомендации по теме
Комментарии
Автор

This guy's a national treasure for the PowerShell world.

bbksvb
Автор

Awesome content as always. Can't believe you do all the work Ad free. Learnt so much from you over the years.

rajh
Автор

Thank you very much John. Coming from a Unix/Linux background and having not much user for Powershell in the past, your videos have been a great help.

MrRealIndian
Автор

One word "Fantabulous" thank you for knowledge sharing, very few does what you're doing.. thank you again.

amit_kala
Автор

Very useful. I just use this yesterday in Detection method in SCCM and Intune. But the verbose thing, that's bring me to the next level. Thank @John .

spiritmorin
Автор

Thanks John for your awesome instruction! I'm new to PS Programming & am loving the Journey. I also will be studying for the AZ-900 exam very soon. All the best to you!

ScottJoseph
Автор

Just AWESOME. Great explanation on how to use try/catch. Thank you, John!

oem
Автор

I have tons of Powershell books, and seen a bunch of other YouTubers videos. You're definitely my top3 if not my top 1 favorite (:

abrahamalaniz
Автор

Great video! I enjoy your teaching style/approach from all videos I've watched, easy to follow and well explained. Great for beginners!

pierredang
Автор

It's really impressive John what you do, and ad free! You are an amazing person!

abcde
Автор

You are a champion John Savill, Thank You. I was exactly looking for this stuff yesterday. Coming from C# background, the try-catch behaves differently in Powershell! Thanks for unravelling it! woohoo ! Brain cells++

iamdedlok
Автор

How simple is that! I've always wanted to deal with errors. Thanks a lot.

cmabr
Автор

Absolutely superb content - thank you!

richard
Автор

Brilliant, thank you John. I’ll be sharing this video and example scripts with my team!

TomWhi
Автор

Wow, top content ! I wish I knew this before struggling with some basic concepts :D

marciobarbato
Автор

Useful video about debug and verbose. I will try to use it in my code. Thanks John 😃👍

Jaynext
Автор

Thank you for this! Now time to rewrite all my scripts haha. Definitely awesome content!

kevinbrekke
Автор

Thanks for Azure Master Class brother. Actually found someone online who wants to impart knowledge with fun and not hook people

TheBondkartik
Автор

Thank you so v much Sir! greetings from ur fan

darryvakki
Автор

Hi, i wonder in minute 15:03, in the switch statement there is $number, and in the statement there is $_ . Why didn't you use the variable number instead of $_ ?

maherriyadh