Maybe a heredoc with per-line `strip` would make this a little more readable:

    powershell = <<-EOS.lines.map(&:strip).join
      function RSC{
      …
      }else{RSC}};
    EOS