5

Apparently, editing a Linux shell script while it is being executed results in an undefined behavior.

What happens when you edit a PowerShell script while it is being executed?

3
  • 5
    Nothing happens. PowerShell reads in, and parses, the entire script before executing it Commented Mar 15, 2020 at 12:37
  • @MathiasR.Jessen Is this behavior of all the PowerShell versions under all the supported platforms? Commented Mar 15, 2020 at 15:37
  • 1
    At least since 3.0, I can't remember (and don't have access to a copy of) version 2.0 Commented Mar 15, 2020 at 15:45

1 Answer 1

1

PowerShell parses everything from top to bottom once and never goes back again.
Once it's in, it's in :)
If you need to reload as example, a PowerShell module into a current session you have to use the -Force flag.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.