If you run a MSH script you probably get an error. The reason for this is that the standard execution policy for MSH is set to restricted.
This is the secure by default mode from MSH. To configure MSH to run scripts you need to change a registry key.
HKEY_LOCAL_MACHINE\ SOFTWARE\Microsoft\Msh\Microsoft.Management.Automation.msh ExecutionPolicy
the default value of this key is restricted, you need to change this to RemoteSigned
MSH recognizes changes to your execution policy immediately.
If you download MSH and unpack the zip file, you find a text file. about_signing.help.txt in this text file you find a more detailed description of this.
There is only one thing. Don’t use unrestricted, RemoteSigned is “unrestricted” enough. You only need unrestricted when you want outlook or internet explorer run unsigned scripts directly from the internet.