I want execute following command without opening admin PowerShell prompt.It should be execute on normal prompt. like we are sudo useradd <username> in Linux.
Enable-PSRemoting;
Set-Item wsman:\\localhost\\client\\trustedhosts $hostIP -Force;
Restart-Service WinRM
I am going integrate this code into C#. Please help me to solve this issue.