Wednesday, October 29, 2008

Code: Powerscript to remove directory


 


 

$ReleaseList = Get-Content '.\ReleaseList.txt'

foreach($Directory in $ReleaseList)

{

Write-Host "Removing Directory: " $Directory

if (Test-Path -Path $Directory)

{    

remove-item -recurse $Directory

}

else

{

Write-Host "Directory does not exist: $Directory"

}    

}

No comments: