Variable error in DelFile()
This commit is contained in:
parent
61b23e2ef3
commit
9c0008eb67
1 changed files with 2 additions and 1 deletions
|
@ -395,7 +395,7 @@ function DelFile {
|
||||||
Write-Host -ForegroundColor Yellow "not found"
|
Write-Host -ForegroundColor Yellow "not found"
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
$command = "Remove-Item $command -ErrorAction SilentlyContinue -Force -Path `"$path`""
|
$command = "Remove-Item $path -ErrorAction SilentlyContinue -Force -Path `"$path`""
|
||||||
if ( $params.ContainsKey('recurse') -and $params.recurse -eq $true ) {
|
if ( $params.ContainsKey('recurse') -and $params.recurse -eq $true ) {
|
||||||
$command += "-Recurse"
|
$command += "-Recurse"
|
||||||
}
|
}
|
||||||
|
@ -500,3 +500,4 @@ catch {
|
||||||
Write-Host -NoNewline -ForegroundColor Red "Error`n`t"
|
Write-Host -NoNewline -ForegroundColor Red "Error`n`t"
|
||||||
Write-Host -ForegroundColor DarkRed $Error[0].Exception.Message
|
Write-Host -ForegroundColor DarkRed $Error[0].Exception.Message
|
||||||
}
|
}
|
||||||
|
ri
|
Reference in a new issue