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

  Рет қаралды 20,979

John Savill's Technical Training

John Savill's Technical Training

Күн бұрын

Пікірлер: 71
@raj35h
@raj35h 3 жыл бұрын
Awesome content as always. Can't believe you do all the work Ad free. Learnt so much from you over the years.
@NTFAQGuy
@NTFAQGuy 3 жыл бұрын
Glad you enjoy it!
@MrSujithn
@MrSujithn 3 жыл бұрын
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.
@NTFAQGuy
@NTFAQGuy 3 жыл бұрын
Great to hear!
@amit_kala
@amit_kala 2 жыл бұрын
One word "Fantabulous" thank you for knowledge sharing, very few does what you're doing.. thank you again.
@spiritmorin
@spiritmorin 3 жыл бұрын
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 .
@NTFAQGuy
@NTFAQGuy 3 жыл бұрын
Glad it helped!
@abrahamalaniz3468
@abrahamalaniz3468 3 жыл бұрын
I have tons of Powershell books, and seen a bunch of other KZbinrs videos. You're definitely my top3 if not my top 1 favorite (:
@NTFAQGuy
@NTFAQGuy 3 жыл бұрын
Thanks
@pierredang8084
@pierredang8084 3 жыл бұрын
Great video! I enjoy your teaching style/approach from all videos I've watched, easy to follow and well explained. Great for beginners!
@NTFAQGuy
@NTFAQGuy 3 жыл бұрын
Great, thanks for watching
@abcde7290
@abcde7290 2 жыл бұрын
It's really impressive John what you do, and ad free! You are an amazing person!
@NTFAQGuy
@NTFAQGuy 2 жыл бұрын
Very kind, thanks 🤙
@oem73
@oem73 3 жыл бұрын
Just AWESOME. Great explanation on how to use try/catch. Thank you, John!
@NTFAQGuy
@NTFAQGuy 3 жыл бұрын
Glad it was helpful!
@iamdedlok
@iamdedlok 3 жыл бұрын
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++
@NTFAQGuy
@NTFAQGuy 3 жыл бұрын
Awesome
@rmontesdeoca
@rmontesdeoca 2 жыл бұрын
Outstanding explanation (as usual)
@ScottJoseph0227
@ScottJoseph0227 Жыл бұрын
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!
@NTFAQGuy
@NTFAQGuy Жыл бұрын
Best of luck!
@richard1101
@richard1101 8 ай бұрын
Absolutely superb content - thank you!
@NTFAQGuy
@NTFAQGuy 8 ай бұрын
Glad you enjoyed it!
@JBLewis
@JBLewis 3 жыл бұрын
Great use of the `Finally` block
@NTFAQGuy
@NTFAQGuy 3 жыл бұрын
Thanks!
@cma9br
@cma9br 3 жыл бұрын
How simple is that! I've always wanted to deal with errors. Thanks a lot.
@NTFAQGuy
@NTFAQGuy 3 жыл бұрын
No problem!
@romanferguson4032
@romanferguson4032 3 жыл бұрын
man the debug and verbose are so cool
@NTFAQGuy
@NTFAQGuy 3 жыл бұрын
💯
@TomWhi
@TomWhi 3 жыл бұрын
Brilliant, thank you John. I’ll be sharing this video and example scripts with my team!
@NTFAQGuy
@NTFAQGuy 3 жыл бұрын
Thanks
@marciobarbato
@marciobarbato 2 жыл бұрын
Wow, top content ! I wish I knew this before struggling with some basic concepts :D
@ec0321
@ec0321 3 жыл бұрын
Very useful John. Thank you!
@TheBondkartik
@TheBondkartik 3 жыл бұрын
Thanks for Azure Master Class brother. Actually found someone online who wants to impart knowledge with fun and not hook people
@NTFAQGuy
@NTFAQGuy 3 жыл бұрын
Very kind, thank you.
@RyanJohnson-kc5eu
@RyanJohnson-kc5eu 3 жыл бұрын
Very Useful. Thanks
@kevinbrekke2471
@kevinbrekke2471 3 жыл бұрын
Thank you for this! Now time to rewrite all my scripts haha. Definitely awesome content!
@NTFAQGuy
@NTFAQGuy 3 жыл бұрын
Thanks 😀
@Jaynext2
@Jaynext2 3 жыл бұрын
Useful video about debug and verbose. I will try to use it in my code. Thanks John 😃👍
@NTFAQGuy
@NTFAQGuy 3 жыл бұрын
Glad you liked it, thanks!
@darryvakki9807
@darryvakki9807 2 жыл бұрын
Thank you so v much Sir! greetings from ur fan
@jreach4487
@jreach4487 3 жыл бұрын
Love the content, John.
@NTFAQGuy
@NTFAQGuy 3 жыл бұрын
Thanks
@shanebagel
@shanebagel Жыл бұрын
John Savill is a bloody legend
@NTFAQGuy
@NTFAQGuy Жыл бұрын
Lol thank you 🤙
@maherriyadh5647
@maherriyadh5647 2 жыл бұрын
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 $_ ?
@NTFAQGuy
@NTFAQGuy 2 жыл бұрын
preference. Code would work if I changed the variable in switch etc.
@dwelfusius
@dwelfusius 3 жыл бұрын
i love this! Thank you
@ibrahimabdeltawab6418
@ibrahimabdeltawab6418 Жыл бұрын
So helpful ❤
@newallst
@newallst 3 жыл бұрын
Awesome 😎
@NTFAQGuy
@NTFAQGuy 3 жыл бұрын
🤙
@robertleist771
@robertleist771 3 жыл бұрын
How about how to catch errors in a try block for commands being executed in a PowerShell remote session?
@alexpetrenko5952
@alexpetrenko5952 3 жыл бұрын
Hi, it was interesting! However, you did not mention how to get that full error code that you used in 'catch'. Or did I missed that?
@NTFAQGuy
@NTFAQGuy 3 жыл бұрын
It’s in the sample file linked in description if I’m following.
@nitti3723
@nitti3723 3 жыл бұрын
Why is the Cmdlet binding needed? Btw love your videos, you present things so well!
@NTFAQGuy
@NTFAQGuy 3 жыл бұрын
Bunch of things including letting you leverage verbose etc parameters
@ravilobo7977
@ravilobo7977 3 жыл бұрын
PowerShell is music. This is like listening to the maestro.
@NTFAQGuy
@NTFAQGuy 3 жыл бұрын
Hehe, thank you
@michaellerch
@michaellerch 3 жыл бұрын
I didn't know that visual studio code had a Light Mode :)
@NTFAQGuy
@NTFAQGuy 3 жыл бұрын
lol. i don't use it normally :-D
@michaellerch
@michaellerch 3 жыл бұрын
@@NTFAQGuy Thanks I finished watching the video and it was really helpful! I've done a little with Try / Catch, but the error stuff I didn't even know about. Thanks again!
@NTFAQGuy
@NTFAQGuy 3 жыл бұрын
@@michaellerch Glad it was useful!
@jgrote
@jgrote 3 жыл бұрын
Powershell VS Code Extension has an "ISE Mode" that makes it look like the old Powershell ISE editor to help ease users of that into vscode. This theme mirrors the look of that app.
@michaellerch
@michaellerch 3 жыл бұрын
@@jgrote I heard about that. I was just playing with Visual Studio Code and was trying to figure that out. I'm sure it's a google search away, but I like to stumble around so I know where everything's at and what it does.
@luizzurobski4462
@luizzurobski4462 Жыл бұрын
ty
@schillaci5590
@schillaci5590 3 жыл бұрын
Oh my god he's gone and put the open curley bracket on the wrong line!
@NTFAQGuy
@NTFAQGuy 3 жыл бұрын
lol, ahhh that universal debate :-)
@David-wh7rm
@David-wh7rm 3 жыл бұрын
@7:22 I've found $($_.Exception.Message) gives better results for me, when using in a write-debug. Great overview though!
@NTFAQGuy
@NTFAQGuy 3 жыл бұрын
3 lines up I grab that in a variable but at this point I wanted to show writing out the whole exception :-)
@David-wh7rm
@David-wh7rm 3 жыл бұрын
@@NTFAQGuy understood and completely fair enough, I didn't put it in a variable so just thought I'd mention, but I know what you mean 👍
@NTFAQGuy
@NTFAQGuy 3 жыл бұрын
@@David-wh7rm All good and agree like the message :-)
PowerShell Master Class - Advanced Scripting Techniques
46:07
John Savill's Technical Training
Рет қаралды 53 М.
Don’t Choose The Wrong Box 😱
00:41
Topper Guild
Рет қаралды 57 МЛН
Calling REST with PowerShell
16:05
John Savill's Technical Training
Рет қаралды 24 М.
PowerShell Errors and Exceptions Handling
27:49
TechThoughts
Рет қаралды 30 М.
New PowerShell Secrets Management Module - Easily use any secret provider
20:15
John Savill's Technical Training
Рет қаралды 17 М.
Power Automate for Desktop Configure Exception and Error Handling
21:17
Daniel Christian
Рет қаралды 10 М.
Debug PowerShell with and without VS Code
40:57
John Savill's Technical Training
Рет қаралды 20 М.
PowerShell Master Class - Data and Objects
46:10
John Savill's Technical Training
Рет қаралды 26 М.
PowerShell Master Class - PowerShell Scripting
33:42
John Savill's Technical Training
Рет қаралды 110 М.
PowerShell Master Class - Automation
46:06
John Savill's Technical Training
Рет қаралды 28 М.