Differences Between Running a Script In ISE versus Powershell.exe

This topic contains 3 replies, has 3 voices, and was last updated by Profile photo of Paul LeDuc Paul LeDuc 7 months, 1 week ago.

  • Author
    Posts
  • #38468
    Profile photo of Paul LeDuc
    Paul LeDuc
    Participant

    Hi,
    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
    Profile photo of Chris Bakker
    Chris Bakker
    Participant

    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
    Profile photo of Michael Maher
    Michael Maher
    Participant

    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

    Michael

  • #38518
    Profile photo of Paul LeDuc
    Paul LeDuc
    Participant

    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.