Differences Between Running a Script In ISE versus Powershell.exe

This topic contains 3 replies, has 3 voices, and was last updated by  Paul LeDuc 2 years, 2 months ago.

  • Author
  • #38468

    Paul LeDuc

    I know that this is probably a really basic question but I am new to Powershell and am learning by the hour. I would like to know the differences between running a script in the ISE versus Powershell.exe? I have a module and script that I have created in the ISE and tested it there. It works as expected. However, as soon as I ran it using powershell.exe , the script ran differently. The only thing I can think is the running environment differs between the tools? Can someone point me in the direction of documentation that may clarify this?

    Thank you,

  • #38508

    Chris Bakker

    Ise is loading a few extra modules, but normaly it should do the same thing,
    If you post the script and specify what is different we can have a look.

  • #38510

    Michael Maher

    Hi Paul,

    Have you done any profile customization?

    The ISE and the PowerShell console have separate profile scripts.

    If you type in $profile it will show you the relevant paths and you can open the file to check it out


  • #38518

    Paul LeDuc

    Thank you for the assistance. I figured out the issue was with the code that I was using to find the script directory.

You must be logged in to reply to this topic.