- 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:

推薦閱讀
- 一本書學內部審計:新手內部審計從入門到精通
- Magento 2 Cookbook
- 審計學基礎
- Microsoft Dynamics NAV Financial Management
- Citrix? XenMobile? Mobile Device Management
- 振蕩指標MACD:波段操作精解(升級版)
- 成功通過PMP(第3版)
- 計量經濟學
- 內部審計情景案例:理解審計行為,辨析審計決策
- Building Dashboards with Microsoft Dynamics GP 2016(Second Edition)
- QlikView for Developers Cookbook
- Microsoft Dynamics CRM 2016 Customization(Second Edition)
- 2014年注冊會計師(CPA)全國統考專用輔導教材系列:審計(名師解讀版)
- 績效考核與薪酬激勵精細化設計必備全書
- PMP 5A備考寶典