About 95,700 results
Open links in new tab
  1. Delete files older than 15 days using PowerShell

    Jun 16, 2014 · I would like to delete only the files that were created more than 15 days ago in a particular folder. How could I do this using PowerShell?

  2. powershell - Remove lines from a text file if it contains a string ...

    I am trying to remove all the lines from a text file that contains a partial string using the below PowerShell code: Get-Content C:\new\temp_*.txt | Select-String -pattern "H|159" -notma...

  3. PowerShell Delete File If Exists - Stack Overflow

    Feb 17, 2022 · Could you help me with a powershell script? I want to check if multiple files exist, if they exist then delete the files. Than provide information if the file has been deleted or …

  4. powershell - Remove-Item (and [System.IO.File]::Delete () ) …

    Apr 27, 2021 · Remove-Item (and [System.IO.File]::Delete () ) removes file that is in use Asked 4 years, 5 months ago Modified 4 years, 5 months ago Viewed 2k times

  5. What's the fastest way to delete a large folder in Windows?

    417 Using Windows Command Prompt: rmdir /s /q folder Using Powershell: powershell -Command "Remove-Item -LiteralPath 'folder' -Force -Recurse" Note that in more cases del …

  6. Find specific file and delete it if exists - Stack Overflow

    Dec 1, 2016 · I am using a couple of variables but normally I use the object returned from the Get-ChildItem cmdlet to find files and use an if statement that is altered. But how can I find a …

  7. How can I recursively delete an entire directory with PowerShell 2.0?

    What is the simplest way to forcefully delete a directory and all its subdirectories in PowerShell? I am using PowerShell V2 in Windows 7. I have learned from several sources that the most …

  8. Delete directory regardless of 260 char limit - Stack Overflow

    May 6, 2013 · Combination of tools can work best, try doing a dir /x to get the 8.3 file name instead. You could then parse out that output to a text file then build a powershell script to …

  9. How do I move a file to the Recycle Bin using PowerShell?

    Jul 1, 2022 · 64 When using the rm command to delete files in Powershell, they are permanently deleted. Instead of this, I would like to have the deleted item go to the recycle bin, like what …

  10. Permission errors in PowerShell - Stack Overflow

    Jul 12, 2016 · Do you actually have permissions to delete the files save.gif and file.txt as documented in the errors?