Invalid use of command line. Type “winrm -?” for help

Sometimes when you are trying to configure WinRM you might be getting an error like this saying “Invalid use of command line”. The reason is you might be trying to execute this in PowerShell as an administrator instead of in the command prompt. As the documentation clearly states that WinRM commands should be executed in command prompt instead of at powershell

So when you are getting an error like this, make sure you are executing those commands as an Administrator in the command prompt. Some of these commands like quickconfig might work in powershell and get executed but always try to execute those commands in command prompt. These errors generally occur when you are trying to enable Basic Auth enabled in WinRM Client or Service

You may also like...