Install logstash as a service via Powershell

Hello. I have a problem. I'm trying to install Logstash as a service in Windows OS via Powershell.
I have run.bat file to start logstash:

logstash.bat agent -f logstash.conf

My PS command looks like:

New-Service -Name Logstash -BinaryPathName "C:\Windows\system32\cmd.exe /c C:\ELK\logstash\bin\run.bat" -DisplayName "Logstash" -Description "Test Logstash service".

But services.msc throws an error 1053. But if I use NSSM for that I have no errors and everything is ok. How to fix that?

Where did you get the PS script from?

@warkolm I have written it based on Microsoft's documentation about PowerShell New-Service function.