+ Post New Thread
Results 1 to 4 of 4
Scripts Thread, prevent powershell closing on error in Coding and Web Development; Hi, I am trying to troubleshoot a powershell script. But it keeps closing when the error message is displayed so ...
  1. #1

    FN-GM's Avatar
    Join Date
    Jun 2007
    Location
    UK
    Posts
    15,822
    Thank Post
    873
    Thanked 1,675 Times in 1,458 Posts
    Blog Entries
    12
    Rep Power
    444

    prevent powershell closing on error

    Hi,

    I am trying to troubleshoot a powershell script. But it keeps closing when the error message is displayed so i cant see what the issue is.

    Does anyone know how i can prevent this please?

    Thanks

  2. #2


    Join Date
    Feb 2007
    Location
    51.405546, -0.510212
    Posts
    8,757
    Thank Post
    221
    Thanked 2,629 Times in 1,938 Posts
    Rep Power
    779
    Open PowerShell (or the ISE) and then run the script from there. e.g.

    Last edited by Arthur; 12th June 2012 at 09:50 AM.

  3. Thanks to Arthur from:

    FN-GM (12th June 2012)

  4. #3
    ascott2's Avatar
    Join Date
    Nov 2007
    Posts
    181
    Thank Post
    18
    Thanked 37 Times in 29 Posts
    Rep Power
    20
    Or from Run you can try:

    powershell -noexit C:\scripts\myscript.ps1

  5. #4

    FN-GM's Avatar
    Join Date
    Jun 2007
    Location
    UK
    Posts
    15,822
    Thank Post
    873
    Thanked 1,675 Times in 1,458 Posts
    Blog Entries
    12
    Rep Power
    444
    why didnt i think of that!!

SHARE:
+ Post New Thread

Similar Threads

  1. Teachers TV to close on April 29th!
    By AngryTechnician in forum General Chat
    Replies: 38
    Last Post: 5th May 2011, 03:39 PM
  2. Replies: 0
    Last Post: 18th March 2011, 11:20 AM
  3. rsync - continue on error
    By srochford in forum *nix
    Replies: 2
    Last Post: 14th March 2011, 03:08 PM
  4. IE Keeps closing on Citrix box
    By cookie_monster in forum Thin Client and Virtual Machines
    Replies: 5
    Last Post: 26th June 2009, 10:38 AM
  5. Replies: 60
    Last Post: 13th March 2008, 05:39 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •