# Listing 4: FileNames2.ps1 # Retrieve the content from the batch file. # Assign the content to the $cmd variable. $cmd = get-content c:\scripts\filenames.cmd # Send the $cmd variable's output down the pipeline. # Remove the "@echo off" command. $cmd = $cmd | foreach-object { $_ -replace "@echo off", "" } # Run the batch command in $cmd. cmd /c $cmd