question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

PowerShellV2/powershell.ts syntax error

See original GitHub issue

The powershell.ts source code line 70 -

        await fs.writeFile(
            filePath,
            '\ufeff' + contents.join(os.EOL), // Prepend the Unicode BOM character.
            { encoding: 'utf8' });  

, while fs.writeFile syntax is fs.writeFile(file, data[, options], callback)

So my self-hosted agent decided to run my powershell task in a container via Node, I ended up with ##[error]Callback must be a function. Received { encoding: 'utf8' } (Node 12.16.2), or ##[error]Callback must be a function (Node 10.15.1).

After providing a dummy 4th parameter, everything works.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:12 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
damccormcommented, May 19, 2020

@waynesi it won’t until its published to your account (and once its published it will replace your cached version anyways). It gets published to your account as part of our release process which will be rolling over the next 3 weeks

0reactions
larssbcommented, May 20, 2020

Okay I’ll try with tfx-cli. Just how do I find the collection URI for e.g. the tfx-cli upload .... cmd?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Powershell syntax error only when running as script [duplicate]
When that is ran manually by copy and pasting into Powershell, it works perfectly. However, when saving that code into a test.ps1 file,...
Read more >
Set-Content (Microsoft.PowerShell.Management)
Writes new content or replaces existing content in a file. In this article. Syntax; Description; Examples; Parameters; Inputs; Outputs; Notes; Related Links ...
Read more >
Solved: "running scripts is disabled on this system" in ...
Press the windows-button on your keyboard. Type 'PowerShell'; Right-click Windows PowerShell; Click Run as Administrator; Run the following ...
Read more >
Error trying to edit dashboard - PowerShell Universal
SyntaxError: JSON.parse: unexpected end of data at line 1 column 1 of the JSON data ... Product: PowerShell Universal Version: 2.0.0 ```.
Read more >
Fix script error an error has occurred in the script on this page ...
Some user's are having this syntax error while try to access the following servers like webex, powershell,hamachi,ebirforms,globalprotect and ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found