Autorun for PowerShell
Solution 1:
You would set up a profile. All commands in the profile are executed every time you start a PowerShell session. There are different profiles for user, machine, etc. As described on MSDN:
Understanding the Profiles
You can have four different profiles in Windows PowerShell. The profiles are listed in load order. The most specific profiles have precedence over less specific profiles where they apply.
%windir%\system32\WindowsPowerShell\v1.0\profile.ps1
This profile applies to all users and all shells.
%windir%\system32\WindowsPowerShell\v1.0\Microsoft.PowerShell_profile.ps1
This profile applies to all users, but only to the Microsoft.PowerShell shell.
%UserProfile%\My Documents\WindowsPowerShell\profile.ps1
This profile applies only to the current user, but affects all shells.
%UserProfile%\My Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1
This profile applies only to the current user and the Microsoft.PowerShell shell.