How to use PowerShell Try, Catch and the Write-Verbose and Write-Debug
About
No channel description available.
Video Description
A look at a few key constructs to help handle errors and troubleshooting in your PowerShell scripts. My Files - https://github.com/johnthebrit/RandomStuff/blob/master/PowerShellStuff/HandlingErrors.ps1 https://github.com/johnthebrit/RandomStuff/blob/master/PowerShellStuff/OutputInfoFunc.ps1 Microsoft Document - https://docs.microsoft.com/en-us/powershell/scripting/learn/deep-dives/everything-about-exceptions?view=powershell-7.1 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 12:09 Errors from cmd.exe 13:25 Messages in scripts 15:09 Using CmdletBinding, Write-Verbose and Write-Debug 17:43 Summary and close
Upgrade Your Gaming Experience
AI-recommended products based on this video

Beelink SER3 Mini Desktop PC with AMD Ryzen 3 3200U 2C/4T, 16GB DDR4 500GB PCIE3.0 X4 SSD, Dual Display Output, WiFi6/BT5.2 W-11 Pro Mini Gaming Computer

Beelink SER3 Mini PC, AMD Ryzen 3 3200U(14nm, 2C/4T) up to 3.5GHz, Mini Gaming Computer 16GB DDR4 RAM 500GB PCIE3.0 X4 SSD, Micro PC 4K@60Hz Dual Display, Mini Computer WiFi6/BT5.2/HTPC/W-11 Pro

Beelink SER3 Mini PC, AMD Ryzen 3 3200U(up to 3.5GHz) 2C/4T, Mini Computer 16GB DDR4 RAM 500GB SSD, Mini Desktop Computer 4K@60Hz Dual HDMI Display WiFi6/BT5.2/WOL/HTPC/W-11 Pro

MSI PRO MP251W E2 24.5-inch IPS 1920 x 1080 (FHD) Gaming Office Monitor, 120Hz, Adaptive-Synch, HDR Ready, HDMI, VGA Port, Display Port,VESA Mountable, Tilt, Speaker, 4-Side Slim Bezel,1ms, White

MSI PRO MP271A E2 27-inch IPS 1920 x 1080 (FHD) Gaming Office Monitor, 120Hz, Free-Sync, HDMI, DisplayPort, VGA Port, VESA Mountable, Tilt, Speaker, 4-Side Slim Bezel 1ms, Black

MSI PRO B650-S WiFi ProSeries Motherboard (Supports AMD Ryzen 7000 Series Processors, AM5, DDR5, PCIe 4.0, M.2 Slots, SATA 6Gb/s, USB 3.2 Gen 2, HDMI/DP, Wi-Fi 6E, 2.5Gbps LAN, ATX)

MSI Pro MP341CQ, 34" Monitor, 3440 x 1440(UWQHD) VA, 100Hz, TUV Certified Eyesight Protection, 4ms, Displayport, HDMI, Tilt

Corsair Vengeance LPX 32GB (2 X 16GB) DDR4 3200 (PC4-25600) C16 1.35V Desktop Memory - Black

EVGA GeForce GTX 1660 Ti XC Ultra Gaming, 6GB GDDR6, HDB Fan Graphics Card 06G-P4-1267-KR

CORSAIR Hydro X Series iCUE Link XH405i Custom Cooling Kit – Hardline Water Cooling Loop – XC7 Elite CPU Water Block – XD5 Elite D5 Pump Res – XR5 360mm Radiator – 3X QX120 RGB Fans

Logitech G203 Wired Gaming Mouse, 8,000 DPI, Rainbow Optical Effect LIGHTSYNC RGB, 6 Programmable Buttons, On-Board Memory, Screen Mapping, PC/Mac Computer and Laptop Compatible - Black

Razer BlackShark V2 X Gaming Headset: 50mm Drivers - Cardioid Mic - Memory Foam Cushion - Lightweight- Comfortable, Noise Isolating Earcups - for PC, PS4, PS5, Switch - 3.5mm Audio Jack - Black ECOLOGO




















