Has anybody created a delete file function to add to the toolkit?
Hey,
Remove-File function is already there in the toolkit, you can use for removing files. Check the document.
-Peace
Hi,
there is a function:
<#
.SYNOPSIS
Removes one or more items from a given path on the filesystem.
.DESCRIPTION
Removes one or more items from a given path on the filesystem.
.PARAMETER Path
Specifies the path on the filesystem to be resolved. The value of Path will accept wildcards. Will accept an array of values.
.PARAMETER LiteralPath
Specifies the path on the filesystem to be resolved. The value of LiteralPath is used exactly as it is typed; no characters are interpreted as wildcards. Will accept an array of values.
.PARAMETER Recurse
Deletes the files in the specified location(s) and in all child items of the location(s).
.PARAMETER ContinueOnError
Continue if an error is encountered. Default is: $true.
.EXAMPLE
Remove-File -Path ‘C:\Windows\Downloaded Program Files\Temp.inf’
.EXAMPLE
Remove-File -LiteralPath ‘C:\Windows\Downloaded Program Files’ -Recurse
.NOTES
.LINK
http://psappdeploytoolkit.com
#>