I created a function in powershell to access a remote docker host from my windows 10 workstation. You should never just expose the docker socket. Always work with certificates. The official docker documentation has a nice step by step tutorial to do exactly that.

function docker02 {docker "-H=docker02.mydomain.net:2376" --tlsverify --tlscacert=C:\ca.pem --tlscert=C:\cert.pem  --tlskey=C:\key.pem $args}

Now I had to insert this command every time I open a new powershell. This annoyed me really fast.

Powershell supports user profiles.

You can check the path with:

$profile

Check if a profile file already exists:

test-path $profile

If “false” use this command:

new-item -path $profile -itemtype file -force

Now you just need to insert the function in the profile file:

powershell_ise $profile

Source: http://www.gsx.com/blog/bid/81096/enhance-your-powershell-experience-by-automatically-loading-scripts