For PowerShell cmdlets, can I always pass a script block to a string parameter?
I'm looking at the document of Rename-Item and there is an example like this. PS C:\>Get-ChildItem *.txt | Rename-Item -NewName { $_.name -Replace '\.txt','.log' } This example shows how to use the Replace operator to rename multiple files, even though the NewName parameter does not accept wildcard characters. This command renames all of the .txt files in the current directory to .log. The command uses the Get-ChildItem cmdlet to get all of the files in the current folder that have a .txt file name extension. Then, it uses the pipeline operator (|) to send those files to Rename-Item . The