Databases Reference
In-Depth Information
You can execute the batch file in the Windows PowerShell environment using .\ or ./ ,asshownin
Figure 2-5:
.\Batch-Test.bat
Figure 2-5
PowerShell cmdlets
PowerShell cmdlets are compiled DLL files that are loaded into PowerShell at runtime. Anybody
can write custom cmdlets using the PowerShell Software Development Kit (SDK). You can get more
information on the PowerShell SDK from http://msdn.microsoft.com/en-us/library/ms714469
(VS.85).aspx .
The cmdlets are constructed in verb-noun format. The verb specifies the action that it is going to perform
and the noun specifies the object being operated on. The noun is always singular (not plural), even if it
retrieves or acts on multiple objects.
The following example is a cmdlet that gets all the processes running on the current host machine, as
shown in Figure 2-6:
Get-Process
Figure 2-6
The term get in this command is the verb, and the term process is the noun, so the cmdlet ''gets'' all the
''processes'' running on the current host.
Amazing, isn't it? You don't have to use VBScript to query the WMI win32 process class and get the
process information and format the result. Just a simple Get - Process command will do that for you.
Search WWH ::




Custom Search