| « Life : Quote from NPR | excel : change excel delimiter » |
| Windws : Fun with powershell | 01/15/09 : Code |
Running a ps1 file at PowerShell start up for all users.
1.Create the following file
C:\Windows\System32\WindowsPowerShell\v1.0\Microsoft.PowerShell_profile.ps1
1. Get the ps1 file signed or be dangerously risky and Set-ExecutionPolicy Unrestricted
When ever PowerShell is started it will run the ps1 file.
I start cygwin on PowerShell start up, My ps1 file looks like this
Text:
| set-alias help get-help # Create the alias help from the cmdlet get-help |
|
| new-item -path alias:cygwin -value /cygwin/cygwin # create an alias from a non-cmdlet |
|
| clear # clear Screen |
|
| cygwin # start cygwin |
So I get this when i start powershell, notice the folder name from before \v1.0\ and the version that appears below.
Windows PowerShell V2
Copyright (C) 2008 Microsoft Corporation. All rights reserved.
user@computerName ~
$_