- PowerShell Troubleshooting Guide
- Michael Shepard
- 100字
- 2021-08-05 16:57:38
Functions
Functions are similar to cmdlets and should follow the same naming conventions. Whereas cmdlets are compiled units of PowerShell functionality written in managed code like C#, functions are written using the PowerShell language. Starting with PowerShell 2.0, it has been possible to write advanced functions, which are very similar to cmdlets. It is possible to use common parameters and risk mitigation parameters with advanced functions. An example of a function is shown as follows:
function get-PowerShellVersionMessage{
param($name)
$PowerShellVersion=$PSVersionTable.PSVersion
return "We're using $PowerShellVersion, $name!"
}
Calling the function at the command line is straightforward, as shown in the following screenshot:

推薦閱讀
- 中國新股民必讀手冊(2015年最新版)
- INSTANT Citrix XenDesktop 5 Starter
- Pentaho Business Analytics Cookbook
- 審計學
- Microsoft Dynamics NAV Financial Management
- 中國特色社會主義國家審計制度研究
- 博弈論及其在經濟管理中的應用
- Metabase Up and Running
- Learning Informatica PowerCenter 9.x
- 基本有用的計量經濟學
- 財務審計實務指南
- 非線性經濟關系的建模
- Salesforce Essentials for Administrators
- 風險導向審計準則實施效果研究
- 企業內部審計全流程指南