Executing Windows Powershell Commands through nexec

Version 2

    The new shell for Windows, Powershell, has some problems with executing remotely. This command will hang indefinitely:


    nexec -i -e cmd /c "powershell C:/scripts/exchange_server_info.ps1"


    But this works:


    nexec -i -e cmd /c "powershell -inputformat NONE C:/scripts/exchange_server_info.ps1"


    Remember to lower your security to run scripts (if you need something more than a command):


    In powershell type: Set-ExecutionPolicy RemoteSigned


    This will let you run scripts, but it doesn't open the server up to scripts downloaded from the network or internet.