Powershell won't run!

Discussion in 'Scripting' started by Patrick Kägi, May 11, 2006.

  1. if i like to run powershell (from shortcut or from
    cmd.exe) the shell closes imediately!

    like:

    C:\Documents and Settings\pkaegi>powershell
    Windows(R) PowerShell
    Copyright (C) 2006 Microsoft Corporation. All rights
    reserved.

    C:\Documents and Settings\pkaegi>


    does anybody have any idea why? and how to fix this?

    thanks a lot and greetings from switzerland
    Patrick
     
    Patrick Kägi, May 11, 2006
    #1
    1. Advertisements

  2. Patrick,

    Which version of PowerShell are you using?

    What is you operating system etc?

    The techniques you describe run PowerShell for me using RC1.

    Andrew Watt MVP
     
    Andrew Watt [MVP], May 11, 2006
    #2
    1. Advertisements

  3. Two ways I can reproduce something like that:

    1. Make my prompt function output "$(get-location)> "

    2. Add "ps PowerShell* | kill" to the top of my profile.
     
    Michael McMullen, May 11, 2006
    #3
  4. I use Version 1.0 of Powershell on Windows XP SP2

    i have also SFU 3.5 installed! perhaps that could be
    the problem? because of ps command which is from SFU
    tools?

    thanks a lot
    patrick
     
    Patrick Kägi, May 11, 2006
    #4
  5. 1) Use MMC to look at the POWERSHELL event log and see if there is any
    information in there
    2) Edit your profile file and put the following line at the top (this will
    tell if if something is going wrong with your script):
    Set-PSDEBUG -TRACE:2
     
    Jeffrey Snover [MSFT], May 11, 2006
    #5
  6. You can edit your profile by using $PROFILE variable..Something like:
    notepad.exe $PROFILE

    --
    Krishna Vutukuri[MSFT]
    Microsoft Corporation
    This posting is provided "AS IS" with no warranties, no confers rights.

     
    Krishna Vutukuri[MSFT], May 11, 2006
    #6
  7. when i start powershell i see the following error in
    my application log:

    ..NET Runtime version 2.0.50727.42 - Absolute path
    information is required.

    does anybody know if this is the problem and what to do?

    thanks a lot
    patrick
     
    Patrick Kägi, May 12, 2006
    #7
  8. i have the same error on every workstation (about
    70) in our company!

    does anybody has a idea what to do? or is there a
    ..Net Runtime newsgroup to ask this?

    thanks
    patrick
     
    Patrick Kägi, May 15, 2006
    #8
  9. Lee Holmes [MSFT], May 15, 2006
    #9
  10. Yes it is set to c:\program files! and i have also
    ..Net 2.0 installed!

    any other hint? i can't wait using powershell ;-)

    thanks
    patrick
     
    Patrick Kägi, May 16, 2006
    #10
  11. If you try to start PowerShell.exe from cmd.exe, do you get any more
    detailed information in your console window?

    --
    Lee Holmes [MSFT]
    Windows PowerShell Development
    Microsoft Corporation
    This posting is provided "AS IS" with no warranties, and confers no rights.


     
    Lee Holmes [MSFT], May 16, 2006
    #11
  12. no it close imediately! only the MS copyright
    information is shown!


    only messages i have is this one in the application
    log (error):
    ..NET Runtime version 2.0.50727.42 - Absolute path
    information is required.



    and this one in the PowerShell log (information):
    Engine state is changed from Available to Stopped.

    Details:
    NewEngineState=Stopped
    PreviousEngineState=Available

    SequenceNumber=18

    HostName=ConsoleHost
    HostVersion=1.0.9567.1
    HostId=7160cfd7-9760-4e9f-8017-0b592248b033
    EngineVersion=1.0.9567.1
    RunspaceId=99a17f6a-792a-4806-848d-2ec77def73d3
    PipelineId=
    CommandName=
    CommandType=
    ScriptName=
    CommandPath=
    CommandLine=



    thanks a lot for your help
    patrick
     
    Patrick Kägi, May 17, 2006
    #12

  13. Lee has found the solution:
    the "Personal" key unter
    HKCU\Software\Microsoft\Windows\CurrentVersion\UserShellFolders\
    was wrong.

    in my case it was set to "h:" instead of "h:\"

    so if you receive the same .Net Runtime Error on
    your machine - try to change this registry key.

    thanks lee for your help
    patrick
     
    Patrick Kägi, May 19, 2006
    #13
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.