Skip to content

Commit

Permalink
Delete if clean variable is true
Browse files Browse the repository at this point in the history
  • Loading branch information
Kinsiinoo committed May 8, 2021
1 parent 1be967d commit abb2110
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions PoshDellDBUtil.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,15 @@
Invoke-Command -ComputerName $Computer.Name -ErrorAction SilentlyContinue -ScriptBlock {
if(Test-Path -Path C:\Windows\Temp\DBUtil_2_3.Sys -PathType Leaf){
Write-Host "Windows->Temp folder: DBUtil_2_3.Sys found!" -ForegroundColor White -BackgroundColor DarkRed
if ($Clean) {
Write-Host "Removing DBUtil_2_3.Sys..." -ForegroundColor Yellow
Remove-Item -Path "C:\Windows\Temp\DBUtil_2_3.Sys"
if(!(Test-Path -Path C:\Windows\Temp\DBUtil_2_3.Sys -PathType Leaf)){
Write-Host "Deleted successfully!" -ForegroundColor White -BackgroundColor DarkGreen
} else {
Write-Host "Error!" -ForegroundColor White -BackgroundColor DarkRed
}
}
} else {
Write-Host "DBUtil_2_3.Sys not found!" -ForegroundColor White -BackgroundColor DarkGreen
}
Expand Down

0 comments on commit abb2110

Please sign in to comment.