added Remove-File function
This commit is contained in:
@@ -512,5 +512,18 @@ function Install-MSP360Module {
|
||||
Catch { LogErr $_.Exception.Message }
|
||||
}
|
||||
|
||||
# Function to delete a file
|
||||
function Remove-File ([Parameter(ValueFromPipeline=$true)][string]$path) {
|
||||
If ( Test-Path $path ) {
|
||||
If ( !((Get-Item $path) -is [System.IO.DirectoryInfo]) ) {
|
||||
Try {
|
||||
LogMsg "Delete ""${path}"""
|
||||
Remove-Item $path -Force
|
||||
}
|
||||
Catch { LogErr $_.Exception.Message }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Setup-MSPDirectories
|
||||
Setup-LogFile
|
||||
Reference in New Issue
Block a user