Prev | Current Page 90 | Next

Joezer Cookey-Gam, Brendan Keane, Jeffrey Rosen, and Jonathan Runyon

"Professional Windows PowerShell for Exchange Server 2007 Service Pack 1"


Part I: PowerShell for Exchange Fundamentals
52
Functions are stored in memory and exposed by the Function provider in the form of the function:\
drive. To view functions, access the function:\ drive by either changing the current location or by
getting a function ??™ s information using the Get-Item cmdlet as shown in this example:
[PS] C:\ > Get-Item function:\get-mailbox2 | Format-list Definition
Definition : param($name) Get-Mailbox $name | Format-List Name, Database, Organ
izationalUnit
Function definitions entered at the command line last only as long as the current shell session from
which they were entered. To have a function available for use each time the shell is started, add
the function definition to the user profile.
Using Profiles
When you create user - defined aliases, variables, and functions, their definitions last only as long as the
current Windows PowerShell session used to create them. Because they are stored in memory, closing the
shell purges them and they are lost.
To have these aliases, variables, and function definitions available for your use each time you start
Exchange Management Shell, create a Windows PowerShell profile script file and add these custom
definitions. Each time the shell is started these definitions are read from the profile script and loaded
into memory.


Pages:
78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102
katalog warszawa Pozycjonowanie konta oszczędnościowe sem palmtop