Try/Catch Blocks

Welcome Forums General PowerShell Q&A Try/Catch Blocks

This topic contains 1 reply, has 2 voices, and was last updated by

5 years, 9 months ago.

  • Author
  • #9651

    Topics: 2
    Replies: 5
    Points: 1
    Rank: Member

    Simple question. Guess I could test it and see what happens, but right now (honestly) I barely have time to post this question. I'm getting tired of 70-hour weeks!
    Can a catch block contain it's own try/catch code? I want to do some cleanup in the catch (not the finally) in case an error occurred, but it is possible that the cleanup code itself could error. I may handle this with a error action preference of Silently Continue, but in the meantime, am just interested to know if I can use try/catch within a catch.

  • #9652

    Topics: 13
    Replies: 4872
    Points: 1,811
    Helping HandTeam Member
    Rank: Community Hero


The topic ‘Try/Catch Blocks’ is closed to new replies.

denizli escort samsun escort muğla escort ataşehir escort kuşadası escort