Advertisement
wetyukmnbxc

Untitled

Feb 16th, 2023
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. AI: Sure, I can help you modify the script. Please try the following script:
  2. $currentDir = Get-Location
  3. Set-Location -Path $folder
  4. $files = Get-ChildItem -Recurse
  5. $fileTypes = $files | Select-Object Extension -Unique
  6. $fileTypes | Out-File -FilePath Result.txt
  7. Set-Location -Path $currentDir
  8.  
  9. This script should take all of the files from the specified folder and write their file extensions to a text file in the current working directory. Don't forget to substitute "folder" with the path to the desired folder.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement