This post is part of the series on PowerShell Snippets.
The following PowerShell command will check if the named file exists in the current directory and, if so, delete it (replace the highlighted section with the name of the file to be deleted):
$FileName = "azrcrv-smtp.zip"
if (Test-Path $FileName) {
Remove-Item $FileName
}
Continue Reading azurecurve’s Article on their blog
PowerShell Snippets: Delete File
This post is part of the series on PowerShell Snippets.
Blog Syndicated with azurecurve’s Permission
More About This Author
Array
Dyn365GP26 July 2024New Functionality In Microsoft Dynamics 365 Business Central 2024 Wave 1: Enable Sustainability Features for Integrations with APIs
Dyn365GP26 July 2024New Functionality In Microsoft Dynamics 365 Business Central 2024 Wave 1: Manage Subscription Billing and Revenue and Expense Recognition
Dyn365GP25 July 2024New Functionality In Microsoft Power Automate 2024 Wave 1: Scale Faster with Power Automate Process Mining Thin Client App
Dyn365GP25 July 2024New Functionality In Microsoft Power Automate 2024 Wave 1: Use the New Desktop Flow Running Timeout Property