Friday, August 7, 2009

How to determine whether a file exists or not in PowerShell script?

This is purely for my personal note, cmdlet "test-path" is the keyword:

if (Test-Path "file_lccation")
{
write-host "the file is there"
}
else
{
Write-Host "the file is missing"
}

No comments:

Post a Comment