Lag spikes/freezes when using multiline String in ps1 file



  • Hey everyone, sorry if this is the wrong place to post this, i am new here.

    In my powershell script i have a multiline String like this:

    @" 
    string content
    "@
    

    Since i added that, i had those lag spikes/freezes where the program would freeze for a second. Since i removed the string, the problem dissapeared.
    I have the language set to powershell, so it highlights keywords etc., so i suspect that somewhere in that highlighting, there is a point where it hangs at multiline strings.



  • @Kevin-Holtkamp said in Lag spikes/freezes when using multiline String in ps1 file:

    @"
    string content
    "@

    With a powershell file with just that content, I don’t notice any lag / freezes. My guess is something else is going on.

    Please go to the ? menu, select Debug Info, and paste the results into the forum.

    Also, see if it freezes for you when all you have in your powershell file is

    @" 
    string content
    "@
    

    If it does freeze from just that, let us know. If not, there is going to have to be more debug.

    My guess is something else is going on: either it’s because of a really long file, or because of one or more plugins, or both. (There could also be many things I haven’t considered.)


Log in to reply