Splatting and positional parameters

So far, all of the parameters that have been used were given were names. It is possible, although rare, to splat positional parameters. This will be demonstrated using the Rename-Item command, which has two positional parameters: path and new name. It is possible to run Rename-Item as follows:

Rename-Item oldname.txt newname.txt

An array may be used to splat these positional parameters:

$renameItem = 'oldname.txt', 'newname.txt'
Rename-Item @renameItem
..................Content has been hidden....................

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