'Cmd to powershell
Hello guys and sirs i need a powershell command of this cmd command is not working in powershell Could anyone help me make this one as ps script?
cls
curl -LJOk "https://github.com/doktor83/SRBMiner-Multi/releases/download/0.8.9/SRBMiner-Multi-0-8-9-win64.zip"
tar -xvf SRBMiner-Multi-0-8-9-win64.zip
cd SRBMiner-Multi-0-8-9
SRBMiner-MULTI.exe --disable-gpu --algorithm verushash --pool eu.luckpool.net:3956 --wallet RTiE77wrw3oNc9Y5M99ckK5vvEppwErtg4.%RANDOM%
Solution 1:[1]
Only a few tweaks are needed:
curl->curl.exe, to make sure that the executable by that name is invoked, rather than Windows PowerShell's (unfortunate) built-incurlalias, which refers to itsInvoke-WebRequestcmdlet. (By contrast, there's notaralias, so there's no strict need to usetar.exe, but it can't hurt.)cdis a built-in alias for PowerShell'sSet-Locationcmdlet, which functions analogously tocmd.exe'scdwith a single, unquoted argument representing the target directory; so while you could retaincdas-is in this case, for a more PowerShell-idiomatic reformulation of your codeSet-Location -LiteralPathis used below.cmd.exe's dynamic%RANDOM%variable, which returns a random number between0and32767, must be emulated with a call to PowerShell'sGet-Randomcmdlet, enclosed in$(..), the subexpression operator, so that the cmdlet's output can be used inside an expandable (double-quoted) string ("..."):
curl.exe -LJOk "https://github.com/doktor83/SRBMiner-Multi/releases/download/0.8.9/SRBMiner-Multi-0-8-9-win64.zip"
tar.exe -xvf SRBMiner-Multi-0-8-9-win64.zip
Set-Location -LiteralPath SRBMiner-Multi-0-8-9
SRBMiner-MULTI.exe --disable-gpu --algorithm verushash --pool eu.luckpool.net:3956 --wallet "RTiE77wrw3oNc9Y5M99ckK5vvEppwErtg4.$(Get-Random -Max 32767)"
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 |
