I am trying to create my pre-uninstallion requirements where I need to only delete certain folders that begin with “ABC.” in a specific directory, and not delete all folders in the directory. How can I achieve this properly since I see there is no wildcard parameter?
Will a Remove-Folder -Path “<path-to-folder>\ABC.*”
work?
I would just do something like this:
$ABC = Get-ChildItem -Path “<path-to-folder>\ABC*” | Where-Object {$.PSIsContainer}
foreach ($ in $ABC) {
Remove-Folder -Path $_.FullName
}
I have yet to be successful posting code on here, hopefully this works…