Forum Discussion
CS_HelpDesk
2 years agoGoTo Contributor
To delete a file.
---
$filePath = $null
if (Test-Path -Path $filePath -PathType Leaf)
{
Remove-Item $filePath -Force
}
else
{
Write-error -Message "$filePath doesn't exist" -Category InvalidArgument
}