Expressions

Switch allows expressions (a ScriptBlock) to be used in place of a simpler condition. The result of the expression should be an explicit true or false, or an implicit Boolean, for example:

switch (Get-Date) {
{ $_ -is [DateTime] } { Write-Host 'This is a DateTime type' } { $_.Year -ge 2017 } { Write-Host 'It is 2017 or later' } }
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.17.203.68