If file exists, delete it

User avatar
daniel
Site Admin
Posts: 223
Joined: Tue Jan 09, 2007 9:54 pm
Contact:

If file exists, delete it

Postby daniel » Fri May 20, 2011 8:35 am

Hereby the code for deleting a (temporary) file

Code: Select all

$tempfile   = "C:\temp\test.xml"

if(Test-Path $tempfile){
   Remove-Item $tempfile
}


Return to “PowerShell”

Who is online

Users browsing this forum: No registered users and 1 guest