You can introduce more .NET into scripts by using more advanced techniques, such as delegate methods. This recipe will also show you what [ref] and [out] types are and what to do when an object method expects such data types.
[ref], [out], and delegates
Getting ready
Install and start PowerShell Core.
How to do it...
Perform the following steps:
- Let's start with a seemingly simple static method, TryParse, in the Boolean class:
[bool] | Get-Member -Static -Name TryParse
- To be able to use this method, the parameter modifier [out] is needed. [Out] indicates that...