function CleanUp powershell code example
Example: powreshell function cleanup
function CleanUp {
# Delete directory content
Get-ChildItem -Path ($PSScriptRoot + "\Files") -Recurse | ForEach-Object { $_.Delete()}
Get-ChildItem -Path ($PSScriptRoot + "\Temp") -Recurse | ForEach-Object { $_.Delete()}
Get-ChildItem -Path ($PSScriptRoot + "\Out") -Recurse | ForEach-Object { $_.Delete()}
}