Update:
The stated requirements are unusual, but the next section provides a solution to address them.
The fact that you later accepted Joma's answer indicates that simply appending .txt to each input file name is what you actually needed; this is most easily accomplished as follows:
Get-ChildItem -Filter *.pdf | New-Item -Path { $_.FullName + '.txt' } -WhatIf
Note: The -WhatIf common parameter in the command above previews the operation. Remove -WhatIf once you're sure the operation will do what you want.
Important: All solutions below create the new files in the current directory. If needed, construct the target file path with an explicit directory path, using Join-Path, e.g.:
Join-Path C:\target (($_.BaseName -replace '_') + $_.BaseName + '.txt')
To create new, empty files whose names should be derived from the input files, use New-Item:
Get-ChildItem -Filter *.pdf |
New-Item -Path { ($_.BaseName -replace '_') + $_.BaseName + '.txt' } -WhatIf
Note: If the target file exists, an error occurs. If you add -Force, the existing file is truncated instead - use with caution.
$_.BaseName is the input file's name without the extension.
-replace '_' removes all _ chars. from it.
To create new files whose names should be derived from the input files and fill them, use ForEach-Object:
Get-ChildItem -Filter *.pdf |
ForEach-Object {
# Construct the new file path.
$newFilePath = ($_.BaseName -replace '_') + $_.BaseName + '.txt'
# Create and fill the new file.
# `>` acts like Out-File. To control the encoding, use
# something like `| Out-File -Encoding utf8 $newFilePath` instead.
"content for $newFilePath" > $newFilePath
}
Note that > / Out-File and Set-Content (for string data) all quietly replace the contents of an existing target file.