Created
October 20, 2024 12:37
-
-
Save mark05e/dd6afefd59e9ea1d9a28a4972329458c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Get all files in the current directory, excluding the output file | |
Get-ChildItem -File | Where-Object {$_.Name -ne "file_contents.txt"} | ForEach-Object { | |
# Print the filename | |
"Filename: $($_.Name)" | |
# Print the file contents | |
"Contents:" | |
Get-Content -Path $_.FullName | |
"------------------------" | |
} | Out-File -FilePath "file_contents.txt" -Encoding utf8 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment