I'm writing my first powershell script:
foreach ($UserDir in Get-ChildItem -Path $NetworkLocation)
{
# if the item is a directory, then process it.
if ($UserDir.Attributes -eq "Directory")
{
$Dir = $UserDir.Name
Remove-Item $Dir +"*" -recurse
}
}
Will $Dir end with a trailing "\" so I can just add a * to delete all files in that directory?