February 2019
Intermediate to advanced
626 pages
15h 51m
English
The array operator, @(), can break up arrays that are used as arguments into operators, or values for parameters.
For example, the format operator, -f, may be used in place of sub-expressions or variable interpolation. @() may be used to define an array to hold the arguments for the operator. The following example shows two different ways of creating the same string:
$item = Get-Item C:\Windows\explorer.exe# Sub-expressions and variable interpolation"The file, $($item.Name), with path $item was last written on $($item.LastWriteTime)"# The format operator'The file, {0}, with path {1} was last written on {2}' -f @( $item.Name $item $item.LastWriteTime)
The same approach may be used for replace operations ...
Read now
Unlock full access