PS
Powershell Tutorial Online

Use Powershell to Delete File

Using PowerShell commnads to delete a file

Example


    # Using PowerShell commnads to delete a file
    Remove-Item -Path "C:\test\FirstCreateFile.txt"
    

Copy and Try it


You can also use wildcard '*' characters to remove multiple items. For example, this command removes all the files in C:\test:

Example


# Using PowerShell commnads to delete all file
Remove-Item -Path "C:\test\*.*"
 

Copy and Try it


Here also you can use -Force command to delete files force fully

Example


# Using PowerShell commnads to delete all file force fully
Remove-Item -Path "C:\test\*.*" -Force
 

Copy and Try it


Here also ypou can use -Force command to delete files force fully

Example


# Using PowerShell commnads to delete all file and folders
Remove-Item -Path "C:\test\*.*" -recurse

Copy and Try it

Delete-SharePoint-Files-With-PowerShell


Powershell Tutorial is optimized for learning technology step by step. Examples might be simplified to improve reading and basic understanding. While using this site, you agree to have read and accepted our terms of use and privacy policy.
Send your suggestions or feedback to [email protected]
Copyright © 2014 by Powershell Tutorial. All Rights Reserved.