Four types of profiles can be defined for use, but for Exchange Management Shell you will probably be
interested in just two of them: a profile that affects only the current user and a profile that affects all
users. The location of the profile script file determines the profile type:
Current User: %userprofile%\My Documents\WindowsPowerShell\Microsoft
.PowerShell_profile.ps1
All Users: windir%\system32\windowspowershell\v1.0\Microsoft.PowerShell
profile.ps1
When Windows PowerShell starts, it checks these locations and loads the Microsoft.PowerShell_
profile.ps1 script files if found; the all users profile is loaded first followed by the current user profile.
By loading the all users profile script, all users have access to the same custom command elements
contained in the script. Additional elements can then be added to the current user profile script for more
specific command elements each individual user requires.
Command elements loaded by the current user profile script override command elements of the same
name loaded by the all users profile script.
??‘
??‘
Chapter 2: Using Exchange Management Shell
53
To create your own current user Microsoft.PowerShell_profile.ps1 script file and open it in
Notepad for editing, run the following commands:
[PS] C:\ > New-Item -Path $profile -ItemType file -Force
Directory: Microsoft.
Pages:
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103