Advertisement
private775

PowerShell: remove a folder if exists and create a new one

Apr 22nd, 2015
421
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $outDir = "c:\temp\XML"
  2.  
  3. If (Test-Path $outDir){
  4.     Remove-Item $outDir -Verbose -Confirm:$false -Recurse
  5. }
  6. [void](New-Item -Path "$($outDir)" -ItemType "directory" -Verbose)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement