These are two ways I can think of about checking whether powershell remoting is enabled/disabled on local machine:
1. create a loop back runspace to local machine and try running a cmdlet in this remote runspace. If this cmdlet works, then the remoting is enabled. This way will be time-consuming.
2. check each component of powershell remoting, such as whether winrm is started, whether firewall exception is configured, whether listener is added... This way could be broken by future powershell update.
Is there a decent way to check whether powershell remoting is enabled/disabled on local machine?